Opened 8 years ago

Closed 8 years ago

Last modified 3 years ago

#5132 closed defect (fixed)

Transifex exports empty android strings

Reported by: n8fr8 Owned by: n8fr8
Priority: Medium Milestone:
Component: Community/Translations Version:
Severity: Keywords: transifex
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

When you export a the localized strings.xml files from Transifex, untranslated strings are included as empty string resources.

As an example, in the default english strings you might have:

<string name="menu_start">Start Tor</string>

and then in another language, say Spanish, if that string is not translated in the transifex UI, you would have:

<string name="menu_start"></string>

By exporting an empty string resource, Android will use that empty string in the user interface, instead of gracefully degrading to the default english value.

This currently means we can only include translations from Transifex that are 100% complete, which is not what we have done in the past via pootle.

Child Tickets

Change History (19)

comment:1 Changed 8 years ago by runa

So, instead of <string name="menu_start"></string>, you want <string name="menu_start"> </string>? Or do you want <string name="menu_start"></string> to just not exist on that line in the file?

comment:2 Changed 8 years ago by runa

From #transifex on irc.freenode.net:

< mpessas> runasand: Just checked the code, we have not activated this, but the idea is that the developer would get the file with the empty strings replaced with the english (source) ones
< runasand> so when you download a 50% spanish translation, the file would actually be 50% spanish and 50% english - not 50% blank? :)
< mpessas> runasand: Right, that is the idea
< mpessas> runasand: It is a one-liner, I just need to ask other android developers on that, too first
< mpessas> runasand: We will enable support for such an option in the client, too (a new version is due within the next day)

n8fr8; if this is the solution you want, let me know and I'll pass it on to the Transifex developers.

comment:3 in reply to:  1 Changed 8 years ago by gsathya

Replying to runa:

So, instead of <string name="menu_start"></string>, you want <string name="menu_start"> </string>? Or do you want <string name="menu_start"></string> to just not exist on that line in the file?

Android automatically defaults to English if the string is not found in the specific language. But, this happens only if the entire line doesn't exist, not if there's a null or empty string.

Ideally. if transifex doesn't have a translation for that string, it should delete that line and not have a null/empty string.
So, <string name="menu_start"></string> shouldn't exist in the file.

comment:4 Changed 8 years ago by Sebastian

I think the best portable option is to use the English original for the untranslated strings in the po file. If we can, it'd be good to use the same stuff project wide, so how much of a hassle would it be to have the English strings in the po file?

comment:5 in reply to:  4 Changed 8 years ago by runa

Replying to Sebastian:

I think the best portable option is to use the English original for the untranslated strings in the po file. If we can, it'd be good to use the same stuff project wide, so how much of a hassle would it be to have the English strings in the po file?

All explained in the second comment.

comment:6 Changed 8 years ago by Sebastian

No, the question was for n8fr8/gsathya :)

comment:7 in reply to:  4 Changed 8 years ago by n8fr8

Replying to Sebastian:

I think the best portable option is to use the English original for the untranslated strings in the po file. If we can, it'd be good to use the same stuff project wide, so how much of a hassle would it be to have the English strings in the po file?

There are no more .po files in the transife world. Everything is maintained as Android resources which is one of the main advantages over the old system.

comment:8 Changed 8 years ago by Sebastian

Ok, then it is an Android resource. The question remains tho, is it actually a problem if untranslated stuff is presented in English?

comment:9 Changed 8 years ago by Sebastian

(in the android resource)

comment:10 in reply to:  8 Changed 8 years ago by n8fr8

Replying to Sebastian:

Ok, then it is an Android resource. The question remains tho, is it actually a problem if untranslated stuff is presented in English?

It is fine for now.

Sorry for weird formatting but trac via Android browser is fugly.

comment:11 Changed 8 years ago by Sebastian

No worries, and thanks. That means we can ask the transifex devs for something they've already done, which probably means we get it faster.

comment:12 Changed 8 years ago by Sebastian

mpessas> Sebastian_: The change in the Android format is live. See http://help.transifex.net/features/formats.html#android-resources, 2nd paragraph.

comment:13 in reply to:  12 Changed 8 years ago by n8fr8

Replying to Sebastian:

mpessas> Sebastian_: The change in the Android format is live. See http://help.transifex.net/features/formats.html#android-resources, 2nd paragraph.

Great. Will give it a shot tomorrow.

comment:14 Changed 8 years ago by n8fr8

Owner: changed from runa, gsathya to n8fr8
Status: newassigned

comment:15 Changed 8 years ago by n8fr8

Owner: changed from n8fr8 to runa

So Transifex is wrong about this: "Android resources is one of the formats that does not fallback to the source strings in case of missing translations." It does fall back. I don't know why they think it doesn't.

It seems like some of the strings are using the method they are stating on the page, where the default English text is filled in. You can see that here:
https://gitweb.torproject.org/translation.git/blob_plain/orbot:/values-ja/strings.xml

However, we still have some empty string files, as seen here:
https://gitweb.torproject.org/translation.git/blob_plain/orbot:/values-ko/strings.xml

Do we just need to have the tor translation bot pull again?

comment:16 Changed 8 years ago by runa

Owner: changed from runa to n8fr8

Has this issue been resolved?

comment:17 Changed 8 years ago by n8fr8

Resolution: fixed
Status: assignedclosed

Yes, i think within the scope of this error, it is good enough for now. Transifex is now filling in the untranslated strings with the values from the source translation file, which in our case is english.

There are some other minor niggles related to locale region mapping to folder names, but that deserves a separate report.

comment:18 in reply to:  17 Changed 8 years ago by runa

Replying to n8fr8:

Yes, i think within the scope of this error, it is good enough for now. Transifex is now filling in the untranslated strings with the values from the source translation file, which in our case is english.

Great.

There are some other minor niggles related to locale region mapping to folder names, but that deserves a separate report.

Ok. Please open a new ticket and list the mappings you want, and I'll take care of it now.

comment:19 Changed 3 years ago by isabela

Component: User Experience/TranslationsCommunity/Translations
Note: See TracTickets for help on using tickets.