9

I have a problem with translations in Project module. Some menu items are not translated. What could be the problem?

enter image description here

Here project_view.xml

<!-- Top menu item -->
<menuitem name="Project"
    id="base.menu_main_pm"
    groups="group_project_manager,group_project_user"
    icon="fa-calendar"
    web_icon="project,static/description/icon.png"
    sequence="50"/>

Here ru.po

#. module: project
#: model:ir.model,name:project.model_project_project
#: model:ir.model.fields,field_description:project.field_project_task_history_cumulative_project_id
#: model:ir.model.fields,field_description:project.field_project_task_project_id
#: model:ir.model.fields,field_description:project.field_report_project_task_user_project_id
#: model:ir.ui.view,arch_db:project.edit_project
#: model:ir.ui.view,arch_db:project.view_task_form2
#: model:ir.ui.view,arch_db:project.view_task_history_search
#: model:ir.ui.view,arch_db:project.view_task_project_user_search
#: model:ir.ui.view,arch_db:project.view_task_search_form
#: model:res.request.link,name:project.req_link_project
msgid "Project"
msgstr "Проект"
forvas
  • 9,801
  • 7
  • 62
  • 158
Danila Ganchar
  • 10,266
  • 13
  • 49
  • 75

4 Answers4

11

I've also had this problem with translations. I had updated module base a lot of times too and it worked, but sometimes it wasn't necessary. What I did is the next process:

  • Go to Settings > Translations > Load a Translation, select your language and check the box Overwrite Existing Terms, then click on Load button.

  • After that, press F5 to refresh the browser, then go to Settings > Translations > Application Terms > Synchronize Terms, select your language and click on Update. Then press again F5 to see if your terms have been updated.

Regards.

forvas
  • 9,801
  • 7
  • 62
  • 158
  • It is weird... Items on left menu was translated. But item on **top menu** was not changed. [Here screen](http://prntscr.com/90qlpe). Do you have any idea? I dance with drum a lot of time :((( – Danila Ganchar Nov 09 '15 at 10:49
  • As I understood, translation for top item **Project** store in `/odoo/openerp/addons/base/i18n/ru.po`. Here source from file `#. module: base #: model:ir.module.category,name:base.module_category_project_management #: model:ir.ui.menu,name:base.menu_main_pm msgid "Project" msgstr "Проект"` – Danila Ganchar Nov 09 '15 at 10:54
  • Yes, that's weird. Every term should have been translated. But now you were able to translate terms on left side doing synchronization, try to update your module, and press F5, and repeat the process above. If you can't see your translation in the top menu, then try to update `base`, just in case (may be after the synchronization it works). – forvas Nov 09 '15 at 11:12
  • It is so strange... Now I tried this solution after reinstallation odoo 9. Even left menu items have not translated. I don't know why. I installed only module `project` and nothing else. – Danila Ganchar Nov 09 '15 at 16:05
  • Yes, it drives us crazy. In version 8, this always happened to me with the module `purchase`. The module was translated to my language during the installation, except for some terms (the top menu option was one of these). So I always refreshed the browser, did the process what I told you in my answer, and, if nothing happened, updated `base`, repeated the process of the answer again, and if same problem, then I updated my own module and repeated the process again. After those attempts, I managed that the translation was updated as I needed. Sometimes actually kind of fluke... – forvas Nov 09 '15 at 16:26
  • I have just come up with another idea. **Try to remove the browser cache** before and after doing the processes I told you. It worked for me sometimes when I had to face off this kind of problem. Good luck ;) – forvas Nov 09 '15 at 18:32
  • I removed cache before. I think issue not in cache. I'll try the solution again with clear odoo. – Danila Ganchar Nov 09 '15 at 19:55
  • It is works! Thank you so much! Good luck in development ;))) – Danila Ganchar Nov 09 '15 at 20:41
4

Sometimes translations don't work very well. Try pressing the "Update" button in the "Base" module. This should solve the problem.

Update: 21 nov 2019

I do not know in older versions, but now there are more options in command line to update, import and export translations. The argument --i18n-overwrite might be useful in your case:

Use these options to translate Odoo to another language. See i18n
section of the user manual. Option '-d' is mandatory. Option '-l' is
mandatory in case of importation

--load-language=LOAD_LANGUAGE
                    specifies the languages for the translations you want
                    to be loaded
-l LANGUAGE, --language=LANGUAGE
                    specify the language of the translation file. Use it
                    with --i18n-export or --i18n-import
--i18n-export=TRANSLATE_OUT
                    export all sentences to be translated to a CSV file, a
                    PO file or a TGZ archive and exit
--i18n-import=TRANSLATE_IN
                    import a CSV or a PO file with translations and exit.
                    The '-l' option is required.
--i18n-overwrite    overwrites existing translation terms on updating a
                    module or importing a CSV or a PO file.
--modules=TRANSLATE_MODULES
                    specify modules to export. Use in combination with
                    --i18n-export
ChesuCR
  • 9,352
  • 5
  • 51
  • 114
  • This solution works on version 8. But in version 9 problem still exist (((. Do you have any idea how to fix this? – Danila Ganchar Nov 03 '15 at 07:32
  • mm that's too bad :/ I didn't work with the version 9 yet. I don't know if the languages are translated in the same way. After updating the base module try to update your custom module as well. – ChesuCR Nov 03 '15 at 15:50
  • 1
    Your solution decides my problem. I could not understand why this way working on 'clear' odoo, but not working on my project. So, I check subversions and found that they are different. After update project to last subversion your solution working is good. Thank you so much! – Danila Ganchar Nov 10 '15 at 11:45
  • I discovered it just now – Danila Ganchar Nov 10 '15 at 11:46
  • AAh! It's a pity that you gave the reputation points to @forvas instead of me xD – ChesuCR Nov 10 '15 at 21:58
  • Year ((( But it's' too late (( – Danila Ganchar Nov 11 '15 at 07:06
2

Sometimes, is not enough to update the base module. I implemented a solution based on a post. What I do is clear the whole language using a query, and then reload the language again using. "Load a Translation" from config menu.

The query that made it possible, is the following, for example for es_CL:

DELETE FROM ir_translation WHERE lang = 'es_CL';

I've put this in a module, which you can use to adapt it to your needs:

https://github.com/odoo-chile/l10n_cl_clear_translation

When this module is instaled it runs the query. Then you can reload your language using the menu.

Daniel Blanco
  • 509
  • 7
  • 14
1

Yes, sometimes the localization doesn't work perfectly. Here's another strategy from v8, which may still help you in v9.

  • First, update your module like described
  • Then, remove all translated strings for your module from the database. This is safe, because you have them in your ru.po file.
    • Go to Settings > Translations > Application Terms > Translated Terms
    • Do an "Advanced Search" with 'Module' 'contains' to find all your terms
    • select them all (possibly set the pager to 'unlimited')
    • Select 'More' > 'Delete'
    • Confirm
  • Update your module again.
  • Export the ru.po file again; it should now contain all missing terms.

The issue seems to be that the module sometimes takes some values from the default (en) language into the target language, which then prohibits the term to be listed as 'to be translated'.

miw
  • 776
  • 4
  • 11