Options for missing strings

More
5 months 4 weeks ago #3527 by protostarDean
I am downloading an additional language source for live events. This gets added as an additional language source. I want it to be used if a term can't be found in the global source.

There doesn't seem to be a MissingTranslationAction that supports falling through to the other language sources.
All of the current options return true in LanguageSourceData.TryGetTranslation(), so LocalizationManager.TryGetTranslation can only ever return strings from the first language source, which is a bit limiting.

It would be great if there was an option MissingTranslationAction .FallThrough that returns false and allows other language sources to be checked.

It would also be great if there was a global option for "What to do if a term is not found in any of the language sources".

Final possible improvement that would really make the system flexible... It would be great if the system could differentiate between a missing Term and a Missing Translation in a particular language.
Use case: My game is localised, but has non essential text that I am only going to add in English. I want to be able to call GetTranslation, and have it return false if the Term exists, but has no translation in the current language, but if the Term is missing completely it should return "[Missing] TERM_NAME" so I know I've forgotten to add it.
To achieve this maybe you could have two options MissingTranslationAction and MissingTermAction.

Thanks for a great product!

Please Log in or Create an account to join the conversation.

More
5 months 4 weeks ago #3528 by Frank
Replied by Frank on topic Options for missing strings
Hi
Thanks for all the suggestions!

There doesn't seem to be a MissingTranslationAction that supports falling through to the other language sources.


Unless there is a regression, thats how the system should work.
When you create LanguageSources or load the assets as Global Sources, they are added to a list.
When someone request a translation, the LocalizationManager, goes over the list, until one of the sources have that Term for that Language.
So, it should happen automatically that if you have SourceA with terms "A1" and "A2", and SourceB with terms "B1" and "B2".
If you ask for B1, it wont be found in SourceA, so, it will look in SourceB and return the translation.

Said that, I will verify that this is working as expected as soon as I get back.

It would be great if the system could differentiate between a missing Term and a Missing Translation


Normally, when there is no term, the GetTranslation should return null.
And when there is no translation it should return "".

Is that what you are seeing on your side?

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out

Please Log in or Create an account to join the conversation.

More
5 months 4 weeks ago #3531 by protostarDean
Thanks for the quick response!
Definitely for the multiple sources, if the term was missing, for all cases of MissingTranslationAction, the source returns true, so it doesn't look in the other sources.

Hmm, I didn't think of that, but, looking at the code:
Only MissingTranslationAction.Fallback ever returns null and I dont think I want that. All the others return Empty.
Missing Term also returns empty.

Please Log in or Create an account to join the conversation.

Time to create page: 0.215 seconds
Template by JoomlaShine