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

Translations files don't translate everything #14848

Closed
AnaKuzina opened this issue May 26, 2021 · 21 comments
Closed

Translations files don't translate everything #14848

AnaKuzina opened this issue May 26, 2021 · 21 comments
Labels
#bug Bug report

Comments

@AnaKuzina
Copy link

Hello! I've modified Russian translations files.
Everything worked great except header tabs and some menu data ("Data", "Charts" in headers tabs, "Manage" in Settings dropdown etc.).
I don't understand what the problem is. Will appreciate any help, thanks!
Снимок экрана 2021-05-26 в 19 59 17

Снимок экрана 2021-05-26 в 19 59 30

@AnaKuzina AnaKuzina added the #bug Bug report label May 26, 2021
@xch-jack
Copy link

xch-jack commented May 27, 2021

Hi,
AnaKuzina
There are punctuation errors in your translation file, please check carefully.

@AnaKuzina
Copy link
Author

Hi,
AnaKuzina
There are punctuation errors in your translation file, please check carefully.

Hi, @xch-jack

Can you please specify what type of punctuation error do I have? Do I need to exactly repeat every tab, spaces and comma that contains english string?

For example, I've translated like this:

msgid ""
"Encountered invalid NULL spatial "
"entry, please consider filtering "
"those out"
msgstr ""
"Обнаружена недопустимая пространственная запись NULL, "
"пожалуйста, рассмотрите возможность её фильтрации"

Is there any punctuation errors?
And I don't understand why most of the files are translated correctly.
Thanks in advance!

@xch-jack
Copy link

Hi,
Open your messages.json file, view the last line, and cannot add a comma.

@AnaKuzina
Copy link
Author

@xch-jack thanks for your help!
The .json file seems to be correct, the last lines are the same as in the translations files here:

Снимок экрана 2021-05-27 в 15 02 12

Any idea what else can it be?

@xch-jack
Copy link

xch-jack commented May 27, 2021

I don't know Russian syntax, but you can try viewing file comparisons in other languages.
Try modifying the meassage.mo file my screenshot location look at, which is the message.mo screenshot location you gave me.
image

@xch-jack
Copy link

Hi,AnaKuzina
I don t know Russian sync grammar but by Chinese grammar the translation in Russian meassage.mo file has many punctuation errors.

@AnaKuzina
Copy link
Author

@xch-jack thank you for your help! I just don't understand why the easiest line aren't translated such as Datasets and Manage - there cannot be any punctuation errors.

I don't understand what is wrong on your screenshot with two wrong sentences... I will look through other languages as an example, thank you for the advice!

@AnaKuzina
Copy link
Author

@xch-jack hi! Thank you for your help yesterday, I've figured it out and it works.

But now I have another problem.

These buttons: "+ dashboard", "+ chart" and other on the main page are not translated. I don't see these strings in .po file as well. Do you know what can be the problem?
Снимок экрана 2021-05-28 в 16 42 46

Thank you in advance!

@xch-jack
Copy link

Hi,
The word translation here needs to find the correct word translation in the front end file, or directly modify in the front end file, it is very troublesome!
The location of the front-end file in superset\static\assets, recommends finding modifications with pycharm.

@AnaKuzina
Copy link
Author

@xch-jack thank you so much! Can you please show me some example of the lines of code where the words are translated in the frontend file?

The main problem is that I use docker file that takes all frontend files etc from the main superset project. So I can't modify it because I don't have permissions =))

And I don't understand why button + chart is translated, but + sql query is not... meanwhile you can see translated + sql запрос below...
Снимок экрана 2021-05-28 в 18 44 55

@xch-jack
Copy link

Hi,
With Docker runtime your front end file is just under superset\static\assets. It is troublesome to modify completely, and you need to find the translated words yourself in the front-end file to modify more places.
There are many places that actually need translation and you have to understand front end files to do.

@xch-jack
Copy link

I give an example that if you are using Pycharm, you can find "VIEW ALL", in the front end file you can find the location you want in your screenshot, there are generally 3 JS files. And this "VIEW ALL" actual word may be lower case may be capital, all you need to understand the front-end file to do the translation.

@xch-jack
Copy link

Of course if you do use a docker-compose-f docker-compose-non-dev.yml up installation in Docker I can do nothing.

@hbruch
Copy link
Contributor

hbruch commented Dec 27, 2021

@AnaKuzina some of the untranslated messages should be translatable now via #17525.

Another issue is that docker-compose-non-dev.yml's apacha/superset:latest-dev image is built without a babel-compile step. I'll shortly submit a PR fixing this.

Finally, there are some i.e. chart related messages which are not yet covered by the babel extraction process, which will hopefully be fixed as soon as the monorepo migration is completed.

@stale
Copy link

stale bot commented Apr 17, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

@stale stale bot added the inactive Inactive for >= 30 days label Apr 17, 2022
@niknoi
Copy link

niknoi commented Sep 8, 2022

#14848 (comment)
Hi, @AnaKuzina can you describe please, how are you fixed this problem

@stale stale bot removed the inactive Inactive for >= 30 days label Sep 8, 2022
@AnaKuzina
Copy link
Author

#14848 (comment)
Hi, @AnaKuzina can you describe please, how are you fixed this problem

I haven't got any decision. I'm still trying to figure out how to translate main page after login. For example the tab with recent dashboards isn't translated.

I found file EmptyState.tsx with the needed line https://github.com/apache/superset/blob/d49fd01ff3e3ee153e5e50352ec2151f028a5456/superset-frontend/src/views/CRUD/welcome/EmptyState.tsx#L77\

But I can't figure out how to pass it into translation. Any ideas?

@artemonsh
Copy link
Contributor

Guys, I am really happy to tell you that I've figured out how to apply all translations that we need. Enter virtual environment and run pybabel compile -d superset/translations. It will point out all the errors you have, for example:

error: superset/translations/ru/LC_MESSAGES/messages.po:189: placeholders are incompatible
error: superset/translations/ru/LC_MESSAGES/messages.po:6433: unknown named placeholder 'tableName'
error: superset/translations/ru/LC_MESSAGES/messages.po:6683: placeholders are incompatible
error: superset/translations/ru/LC_MESSAGES/messages.po:13100: placeholders are incompatible
error: superset/translations/ru/LC_MESSAGES/messages.po:13975: positional format placeholders are unbalanced

Then simply edit all of the messages to avoid errors and run the compile command again!

@rusackas
Copy link
Member

Closing this since I believe @artemonsh tackled the translations at hand, and all is well. Also, this is not a bug, per se, but just a long tail area that has always needed attention in Superset, and likely always will. If anyone has interest in contributing to this effort, please ping me on the Superset Slack, and perhaps we can start a working group that tackles this on a regular basis.

@hbruch
Copy link
Contributor

hbruch commented Mar 25, 2023

Whoever comes here because some messages appear untranslated, should have a look into the CONTRIBUTING#translating section which might already answer some questions. Also, the Slack-localization channel might be a good place to coordinate work on translations.

@Atmostone
Copy link

Still have similar issue in latest versions (4+)
When I set default language not to English

`BABEL_DEFAULT_LOCALE = 'ru'

LANGUAGES = {
'ru': {'flag': 'ru', 'name': 'Русский'},
'en': {'flag': 'us', 'name': 'English'},
}`

Then en version breaks at same places like in this issue

ru version: OK
image
en version: broken
image

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

No branches or pull requests

7 participants