-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String arrays with missing translations #12
Comments
Hm yes, so there actually exists an argument that makes the function in question include untranslated strings, but it's not used by default (and it would affect non-arrays as well). There is also a comment that I no longer understand. I'll need to take a closer look. Using the default values for arrays generally seems easy enough to do, as long as the .po file contains the untranslated message. If the message is missing, i.e. the .po file is incomplete, then this is an impossible problem to solve right now, because the Import command would not have enough information (it doesn't know the maximum array length and does not look at the original file). Fortunately, that should rarely be the case. At some point comments may possibly be used to encode additional information. This would solve a lot of these sorts of issues. |
Second this - arrays that are of the wrong size cause nasty bugs with android apps - and prevent strings files from being usable after a2po is finished with them :( |
I've started using |
I'm not sure this was actually fixed. On 1.3.dev (latest git), when I try to import .po files with incomplete arrays, I have several problems: order is changed, and some incomplete arrays are still incomplete. In my opinion, incomplete arrays should not at all be imported, or alternatively the missing strings should be replaced with the same string in the source language. |
That's what it's supposed to do. Look at this test which is passing: https://github.com/miracle2k/android2po/blob/master/tests/convert/test_string_arrays.py#L122 What is different in your case? I notice that in the test, both array items exist in the .po file, but one has no translations. There is no test for when one item has not occur in the .po file at all. |
a2po exports an Android string array such as to keys like my_strings:1, etc.
If some of the strings in the string-array are not translated in some languages (for example, a new string is added to the array in the default language, but some of the translators haven't had a chance to translate it yet), when the array is imported back in to the Android xml, it will be missing some items for the affected languages, and if that array is used in a Preference, the Preference will be missing some items.
It would be better to either force the default values for the missing array items, or to fully remove the array from the Android xml if any item is missing.
The text was updated successfully, but these errors were encountered: