• Resolved rkwpu

    (@rkwpu)


    Hi

    Do i understand correctly that under directory /usr/local/www/domain.com/http/wp-content/plugins/owm-weather/lang is possible to add custom language? I have new language with poedit but it does not show up in menu as option to choose. Also if i edit some other language file then custom translation does not show up. Still takes somewhere else. OWM? Can you clarify development process for language files please

Viewing 15 replies - 1 through 15 (of 23 total)
  • Plugin Author Uwe Jacobs

    (@uwejacobs)

    This plugin started as a fork of the discontinued plugin WP Cloudy. The translations are still from the old WP Cloudy plugin but many labels have been added or changed names with OWM Weather. I will look into the language file setup and correct it in one of the next versions.

    Thank you for providing translations for this plugin!

    Plugin Author Uwe Jacobs

    (@uwejacobs)

    I revised all translation stubs and created the master .pot file in the lang subdirectory.

    You need to create the files owm-weather-xx_XX.po and owm-weather-xx_XX.mo (xx_XX is your language code) and place them in the lang sub-directory. The .pot file helps you to get started should you only have the free PoEdit version.
    I will gladly add your translation files to the plugin (with proper acknowledgment in the readme file).

    There is very useful information on WordPress Localization at https://developer.ww.wp.xz.cn/apis/handbook/internationalization/localization/.

    Thread Starter rkwpu

    (@rkwpu)

    Hi

    I have created from pot file new empty language file and saved it but after extracting to lang dir (proper file permissions) new language country does not show up on language selection list. Just in case lang po and mo files for you to test:

    https://file.io/qYGpPnLe5pRI

    • This reply was modified 4 years, 3 months ago by rkwpu.
    Plugin Author Uwe Jacobs

    (@uwejacobs)

    OWM Weather automatically uses the language from the general system settings. There is no other setting within OWM Weather.

    Your .po looks correct but it does not have any translations yet.

    Is your language set to “Eesti” in the system settings?

    Thread Starter rkwpu

    (@rkwpu)

    Language is set to Estonia in po file and issue is that under OWM plugin lang settings new language as country option does not show up

    https://ibb.co/4djgrbD

    Plugin Author Uwe Jacobs

    (@uwejacobs)

    The language for OWM Weather itself is governed by the WordPress System setting “Site Language”, see https://imgur.com/rgdAwEr. If your WordPress site language is set to “et_EE”, OWM Weather will pick up the translations from owm-weather-et_EE.mo.

    The weather post setting “OpenWeatherMap language?” is for the language that openweathermap.org will send back with its data (see the list of languages at https://openweathermap.org/api/one-call-api#multi). It is not influenced by anything that’s in the .pot or .po files. I’ll revise the description in one of the future releases.

    Does that make sense?

    Thread Starter rkwpu

    (@rkwpu)

    Hi

    I tested. I set under site language to “Eesti” and translated some strings to estonian in .mo/po file but plugin does not pick owm-weather-et_EE.po/mo

    Can you please verify?

    Plugin Author Uwe Jacobs

    (@uwejacobs)

    The WP_LANG variable for site language Eesti is just “et” – not “et_EE”. Please rename your files to owm-weather-et.po/mo and it should work.

    Thread Starter rkwpu

    (@rkwpu)

    Hi

    I tried. Sadly no go. Translation still not used

    Plugin Author Uwe Jacobs

    (@uwejacobs)

    When I tested this myself, at first I forgot to give the copied files the correct permission and it didn’t work. Can you double-check the permission for the owm-weather-et.mo file.

    Thread Starter rkwpu

    (@rkwpu)

    File permissions are correct. Install folder should be wp-content/plugins/owm-weather/lang ?

    Plugin Author Uwe Jacobs

    (@uwejacobs)

    I made some changes to the textdomain and menu loading order in version 5.1.2. Please update to the new version and try again.

    Thread Starter rkwpu

    (@rkwpu)

    I updated plugin. Cleaned cache. Re uploaded files. WP site language is Eesti. Tried but language translation is not in use. I have four files just in case:

    -rw-r–r– 1 www www 25K Mar 2 15:56 owm-weather-et.po
    -rw-r–r– 1 www www 1.7K Mar 2 15:56 owm-weather-et.mo
    -rw-r–r– 1 www www 25K Mar 1 16:24 owm-weather-et_EE.po
    -rw-r–r– 1 www www 1.7K Mar 1 16:25 owm-weather-et_EE.mo

    WP version is 5.9.1

    Plugin Author Uwe Jacobs

    (@uwejacobs)

    That is really odd.
    
    I copied the .pot file to owm-weather-et.po in the own-weather/lang/ directory. Then I used Google Translate to translate just the menu phrases. Finally, I created the .mo file with msgfmt and set the WordPress site language to Eesti. As you can see, the menu items are now showing up in Estonian: https://imgur.com/1VDaHkY.
    I also finished the German translations. When I set the site language to Deutsch, everything shows up in German. Same with the partial Spanish translation (site language Espaniol).
    
    Could you try setting the WordPress site language to Deutsch and check if the custom post name Weather changes to Wetter?
    Thread Starter rkwpu

    (@rkwpu)

    hi

    Wordpress menu changes for me to estonian as well but OWM final weather page does not change. https://ibb.co/TY4Y5m7

Viewing 15 replies - 1 through 15 (of 23 total)

The topic ‘Custom language’ is closed to new replies.