Skip to content
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

Translation strings are not translated #1902

Closed
peterdekker opened this issue Nov 14, 2018 · 17 comments
Closed

Translation strings are not translated #1902

peterdekker opened this issue Nov 14, 2018 · 17 comments

Comments

@peterdekker
Copy link

peterdekker commented Nov 14, 2018

I have created a Dutch translation for PYBOSSA. However, when I test it, I see that a part of the translation strings is not used. This results in mixes of translated and untranslated phrases in the interface.

Eg. I translated this string in the login window:
#: themes/default/templates/account/signin.html:7 msgid "" "below you are agreeing to\n" " the" msgstr "" "hieronder verklaart u dat u akkoord gaat\n" "met de"

It looks like this in the interface:
https://screenshots.firefox.com/z1EDwxIquekUKBpf/localhost

There are more places where I saw this.

Thanks in advance for looking into this!

@teleyinex
Copy link
Member

Be sure that in the bottom of that file, after you have run the merge, you don't have empty strings. I would say this is the first guess without seeing your translation file. Can you share it?

@peterdekker
Copy link
Author

I don't think there are any empty strings at the bottom of the file.
Our translations file is here:
https://github.com/INL/taalradar/blob/master/translations/nl/LC_MESSAGES/messages.po
Thanks :)

@jeanphilippegoldman
Copy link

jeanphilippegoldman commented Nov 15, 2018 via email

@peterdekker
Copy link
Author

@jeanphilippegoldman I tried to remove the \n" " (at the position of the space is actually a line break). I also fixed some errors using the POFileStatus and POFileChecker tools from gettext-lint. Still it does not work.
However, POFileStatus does say that there are 4 missing translations. Could this pose a problem? And any idea how to find them?

@teleyinex
Copy link
Member

Hi,

I can see that your file is ok, but it's missing several strings. I've run the update on my local branch and this is the file that I get:

messages.zip

At the end of the file you will find several strings that start with #. Just remove the hash, and translate them. Then recompile. This should do the trick.

@peterdekker
Copy link
Author

Thanks for your suggestion! I added the 4 empty translation strings from your file to my file, and translated them:

msgid "Sobre el mosquito tigre y de la fiebre amarilla"
msgstr "Over de tijgermug en de gele koorts"

msgid "Sobre las enfermedades"
msgstr "Over de ziekten"

msgid "Empieza a clasificar"
msgstr "Begin met classificeren"

msgid "About the tiger mosquito and yellow fever"
msgstr "Over de tijgermug en de gele koorts"

However, I still get the mixed translations in the login screen. Any ideas?

@peterdekker
Copy link
Author

I can report that the same problem occurs with the Portuguese translations from the repository. So probably it is not a problem in the translations file, but in the application code.
https://screenshots.firefox.com/72Bw6oc5kQVZxRkC/localhost

@teleyinex
Copy link
Member

The Portuguese translation is not up to date, so that's why it's not showing it. Checking the other.

@teleyinex
Copy link
Member

For the Spanish version it happens the same. The Not registered string is not translated it.

@teleyinex
Copy link
Member

So, after checking the translations file, I found that some strings were not translated. I've done the Spanish version now: Scifabric/pybossa-default-theme#174

Can you try it? It should show your site in Spanish, and the signin page in Spanish as well. If you compare the master vs the spanish-translation branch you will see how the master renders Spanglish, while the spanish-translation branch shows everything in Spanish.

Thus, the issue is with the translation files not being fully translated. Can you try to update your translation files again? I've just followed the instructions in the docs, and they work really well.

@peterdekker
Copy link
Author

peterdekker commented Mar 19, 2019

Hi, I followed your instructions, and it did not work yet. The generated messages.pot file is empty. I found out that this happens, because the paths in babel.cfg file are wrong.
babel.cfg in my pybossa dir is taken from the pybossa-default-theme repo, and it seems the paths in that file still point to that repository: https://github.com/Scifabric/pybossa-default-theme/blob/94a6e8257e998df9ff388e95adb87eccaa423e45/babel.cfg

I changed babel.cfg to:

[python: **.py]
[jinja2: themes/default/**/templates/**.html]
[jinja2: themes/default/templates/home/_pybossa_text.html]
extensions=jinja2.ext.autoescape,jinja2.ext.with_

Now actually the right translation strings are generated in messages.pot and in the language-dependent messages.po file.

EDIT: However, now I have a LOT of untranslated strings, and also a lot of strings I translated previously, which are not needed anymore. Could this be correct?
This is my messages.po for Dutch: https://pastebin.com/QtqjjeUG

@peterdekker
Copy link
Author

peterdekker commented Mar 25, 2019

I can also confirm that the spanish-translation branch gives a good translation, while the translation on the master branch gives a partial translation.
@teleyinex Could you help me out with my questions: are my changes to babel.cfg correct? And is the resulting po file I pasted correct?

@teleyinex
Copy link
Member

Yes, the changes to babel.cfg are ok. That's a bug that we need to fix here. Regarding the partial translations: did you follow this https://docs.pybossa.com/translating/#step-1-extract-new-strings-which-should-be-translated

@peterdekker
Copy link
Author

Thanks! Yes, I followed the steps from the tutorial. After step 1, I get the following messages.pot: https://pastebin.com/MrTtYtSv

@teleyinex
Copy link
Member

Then, go for step 2. It should update with existing translations, if any.

@peterdekker
Copy link
Author

After step 2, I get this messages.po, with a lot of strings deactivated and a lot of new strings added: https://pastebin.com/DCL0P0mR
Is this expected behaviour?
If it is, I can immediately proceed with fixing this Dutch translation, and starting translation for a number of new languages.

@teleyinex
Copy link
Member

Closing it as this has been not updated in a long time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants