• Resolved alphax

    (@alphax)


    Hi,

    I have followed your guide https://wpjobmanager.com/document/translating-wp-job-manager/ and have done the following

    1) downloaded the already existing German files wp-job-manager-de_DE.po and wp-job-manager-de_DE.mo from wp-content >> languages >> plugins
    2) downloaded and installed PoEdit and opened the .po file
    3) translated a string and saved the .po and .mo file
    4) uploaded the saved files back to wp-content >> languages >> plugins and overwrote the existing .po and .mo

    However, the page is still showing the “old” German translation that already existed and isn’t taking my new string translation.

    Could anyone please help me? What am I doing anything wrong?

    Many thanks
    David

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Contributor Cena (a11n)

    (@cena)

    Hi @alphax (David :)),

    To clarify, have you done these bits:

    – When you are finished translating, go to File → Save as… again to generate the MO file.
    Or you can set your Poedit to always compile a MO file when saving changes by clicking File → Preferences and on the Editor tab check the Automatically compile .mo file on save box.
    – Upload your PO and MO file to wp-content/languages/wp-job-manager/

    Just checking since you mention you “uploaded the saved files back to wp-content >> languages >> plugins”, which is incorrect. ??

    Best,
    Cena

    Thread Starter alphax

    (@alphax)

    Hi @cena

    Thank you for your response!

    (1) My POedit automatically generated a new .MO file.

    (2) I haven’t done that as I followed the advice on https://wpjobmanager.com/document/translating-wp-job-manager/ where it states:

    Put Translations Inside the WP_LANG Directory
    If the plugin supports it (WP Job Manager 1.18.1 does, and so do the latest add-ons) you can put your po and mo files in the WP_LANG directory which will keep them safe from updates. This is usually the wp-content/languages/ directory.

    So for example, if you were translating the Resume Manager add-on, you would put your mo file in wp-content/languages/plugins/wp-job-manager-resumes-LOCALE.mo, replacing LOCALE with your language code.

    Given, I do want to protect my translations / .mo files from updates, I have followed this guidance.

    Could you please clarify why this is incorrect and if I follow your guidance (which is indeed also on top of the documentation page) how I would protect my translations?

    Thank you very much!

    Kind regards,
    David

    Thread Starter alphax

    (@alphax)

    @cena Could you please help me on the above?

    Many thanks
    David

    Plugin Support bindlegirl (a11n)

    (@bindlegirl)

    Hi David,

    You are right, our documentation mentions both locations for saving translation files, wp-content/languages/wp-job-manager/ and wp-content/languages/plugins/wp-job-manager-resumes-LOCALE.mo.

    Saving files to either of those locations will work but the wp-content/languages/plugins/wp-job-manager-resumes-LOCALE.mo one is considered as safer. However, if you decide to use a different translation plugin at some point (for example Loco Translate) you will notice that the files saved there don’t get recognized by those plugins. That doesn’t mean WordPress itself won’t recognize them.

    As for your original issue, I suspect you have several translation files and since some files get priority while loading, the one that you want to use gets overridden.

    For example, if you save wp-job-manager-de_DE.mo files in wp-content/languages/plugins/ as well as in the wp-content/languages/wp-job-manager/, the first one will have priority when loading.

    I suggest you try removing the other translation files.

    Another possible cause of the problem could be the WordPress language you chose was not the DE_de one (Deutch) but any of the other locales.

    Thread Starter alphax

    (@alphax)

    Hi @bindlegirl

    thank you very much for your answer.

    I already had my two files
    wp-job-manager-de_DE.mo
    wp-job-manager-de_DE.po

    in the folder wp-content/languages/plugins/ without effect.

    I didn’t have my translations in wp-content/languages/wp-job-manager but for testing have created the folder as well and uploaded in there, again without effect.

    To test things further, I have deleted the .mo and .po DE files in both folders again and the default German translation is still there.

    So I’m lost where the current German translation is coming from.

    I have set my WP page to German and I understand that German is by default already available by the WPJM (= a core translation). So my best guess is that the core translation is providing the German translation and the file must be saved somewhere else. I already had a look in wp-content/plugins/wp-job-manager/languages but there is only one .pot file (no German files).

    To summarize:
    * wp-content/languages/plugins/ => no German translation file other than mine
    * wp-content/languages/wp-job-manager/ => no German translation file other than mine
    * WPJM is still somehow translating into German

    It would be really great to resolve this soon and I’d much appreciate if someone could please help me!

    Thanks
    David

    Plugin Support bindlegirl (a11n)

    (@bindlegirl)

    Hi David,

    Since you have removed the translation files from your server and the site is still loading the translation files, I would recommend you try clearing any site/server cache to see if that is the reason you still see the translations.

    You may want to ask your host to help you figure this out.

    Thread Starter alphax

    (@alphax)

    Hi @bindlegirl

    Thank you for your answer.

    So you are saying it’s not the core translation files that are shown (which may be saved somewhere else that I don’t know of)?

    As you suggested, I have cleared my server (and browser) cache few times. I have also deleted the wp-job-manager-DE .mo and .po files in the two translation locations. However, I’m still seeing the German core translation.

    Where are the core translation files saved?

    Shouldn’t any wp-job-manager-DE .mo and .po files in either of the folder locations (within wp-content/languages) supercede / have higher priority over the core default translation?

    I really struggle to understand why the translation of this plugin is so frustratingly difficult.

    I’d very much appreciate any help to resolve this soon.

    Many thanks,
    David

    Thread Starter alphax

    (@alphax)

    Follow-up:

    I have also just now installed Loco translateand translated the string and saved it (also emptied server and browser cache). However, it’s not having any effect either.

    It seems that WP Job Manager is forcing it’s own core translation without allowing other translations.

    Thread Starter alphax

    (@alphax)

    Could someone please help to make the translation work?

    @alphax
    have you also tried resaving your permalinks? Sometimes this helps as well.
    We had this little problem with a translattion back in the days as well.
    Check also your childtheme, maybe there is another mo/ po file located.
    In a few cases the tranlsation is commming from your theme as well, regarding the wpjm.
    Did you clear the Wp cache was well?

    Thread Starter alphax

    (@alphax)

    Hi @braehler

    Thanks a lot for your hint with regards to the child theme, this gave me to understand that theme translations have higher priority. Whilst I didn’t have any child-theme translation, I found a a .mo and .po translation file in the parent theme folder (within /languages).

    I renamed them to inactivate and found out when refreshing the page that they are indeed providing the translation. So it all makes sense why nothing on the plugin level was working. Finally a big step forward, thanks a lot!!

    I then downloaded the de_DE.po and de_DE.mo from the parent’s languages folder, made a string edit and uploaded them to a new ‘languages’ folder in the child-theme. After googling I found out that you also have to add the following template code to the child-theme functions.php:

    function my_child_theme_locale() {
        load_child_theme_textdomain( 'total', get_stylesheet_directory() . '/languages' );
    }
    add_action( 'after_setup_theme', 'my_child_theme_locale' );

    However, the child-theme is still not showing the new translation from the child-theme. When I upload the new files to the parent’s ‘languages’ folders, it works and the translation is shown. So somehow the child-theme translation files are not being loaded.

    Would you know what the issue could be?

    Many thanks,
    David

    Thread Starter alphax

    (@alphax)

    Hi @braehler

    This may be helpful later in translating other plugins (like WooCommerce Bookings) – thank you!

    However, with regards to the current issue, I’ve spend more time researching… and eventually found this https://kb.astoundify.com/article/282-create-a-full-translation/ where it says that there is another location in wordpress where theme translations can be saved, namely in: wp-contenet/languages/themesand then having the name convention of THEMENAME-de_DEfor each .mo and .po file. This finally worked! I hope this location is save from updates, but given there wasnt already a translation file from my theme, I’d expect so.

    Thanks a lot again for your guidance, the hint with the theme, solved it eventually! Really appreciate it! Also, thanks again to the previous supporters.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Problem with translation via PoEdit’ is closed to new replies.