Feature request for localization - description for variables on Transifex

Not sure if this is more appropriate for zotero-dev, github or here, but here we go.

As a localizer, I'd love to see variables (such as %S) in strings on Transifex to come with short descriptions (such as, "browser", "application", "word processor", etc.)

I translate Zotero (as an amateur -- I have no formal education in this) for a language that loves suffixes. For example, English prepositions usually become suffixes, which change their sounds depending on the vowels and consonants of the root word.

This makes it impossible to translate correctly when variables (%S) are being translated and one doesn't know what that variable is about. For example:

The "to %S" in "Welcome to %S!" would be translated as

"Zotero'ya / Firefox'a / Safari'ye / Word'e hoşgeldiniz" in Turkish. See the ya/a/ye/e for the proposition "to". It gets worse for other prepositions.

The solution other projects take is to use the following construct:

"%S programına hoşgeldiniz!": "Welcome to the program %S!"
"%S tarayıcısına hoşgeldiniz!": "Welcome to the browser %S!"

So, offload the preposition on a fixed string, like 'browser'.

I can sometimes figure this out from the string key, but many times, I cannot. A short description of the variables within the string will immensely help.

(I assume this will be a problem for all agglutinative languages with some form of sound harmony: Korean, Finnish, Hungarian, etc. ?)
  • I agree that's not always evident to find out the meaning of a variable.

    But once you know the name of the string key, you can search for it in the code of Zotero. It's easier and more efficient to do it locally, but maybe you can try on GitHub.

    For example, with the key "connector.name" that you found on Transifex, go to https://github.com/zotero/zotero and search for (in "This repository"):
    "connector.name" path:chrome/content/zotero/ (make sure the string key is enclosed in quotation marks).

    Then you can track down the origin and the context of the string…
  • Thanks. Will look for them in the source code.
  • Continuing the older thread, as it is very relevant...

    I have a problem when more than one variable is being called. For example, take the new string, zotero.preferences.sync.reset.restoreToServer:

    %S will replace data in “%S” on %S with data from this computer

    There are three variables, which use the following arguments according to code on GitHub: [Zotero.clientName, library.name, ZOTERO_CONFIG.DOMAIN_NAME]

    Unfortunately, for the language I translate (Turkish), the second and the third variables will have to switch places as I translate. Similar things will happen in many languages where the word order is different from that in English. Is there not a way to specify how arguments are ordered? Maybe some numbering scheme I remember seeing before (like $1S, $2S, etc.), so that the arguments will not result in jumbled places in the translations?

  • Ah, sorry about that. I've fixed that in the new string, so you can retranslate with the numbered placeholders.
  • That was fast! Thank you.
  • I may have come across another string that has two variables, but not using numbered placeholders.

    The string sync.error.invalidDataError appears to call two variables: Zotero.Libraries.get(e.libraryID).name and Zotero.clientName.

    But the untranslated string is as follows: "Some data in %S could not be downloaded. It may have been saved with a newer version of %S."

    I apologize if I missed something here.
  • There's nothing inherently wrong with multiple variables without numbered placeholders — there are lots of strings like that. It's only an issue when a localization would need a different order, and that shouldn't be the case for something like this where the words appear in separate sentences.
  • Got it. True, I have come across many of those. Thank you.

    Somehow this was initially hard to translate with the variables and the third-person singular pronoun causing an ambiguity in the translation. Issue resolved, I think.
  • From the latest batch of strings to be translated: "%S can attempt to restore from the last automatic backup from %S at %S."

    I cannot think of a simple way to translate this without changing the order of the second and third variables. In Turkish, it would have to go: "%1$S, %3$S-at %2$S last automatic backup-from restore attempt-can."

    Would it be possible to number these placeholders?
  • In case it's not clear, that's just for date and time. If there's nothing equivalent to "05/25/2020 at 07:46:12 PM" in Turkish, you can just use a space, which is what it would be in the Turkish locale if we requested a single string ("25.05.2020 19:46:22").
  • (Or maybe I'm misunderstanding what the problem is?)
  • edited May 25, 2020
    Ah, I had just assumed "at %S" was the physical location for the backup. I did not see a reason to check github for that. There is no issue then. Thank you!
Sign In or Register to comment.