• Resolved Anonymous User 22040435

    (@anonymized-22040435)


    Wie macht man seine eigenen übersetzungen updatesicher?

    So muss ich paid-memberships-pro-de_DE_formal.po (+mo) übersetzen (vorerst mal lokal, einfach per Poedit) und so auslagern, dass diese beim n?chsten Update nicht überschrieben werden.
    (Leider gibt eure Anleitung keine Auskunft darüber.)

    Ich habe alle g?ngigen Methoden ausprobiert, aber es wird stets nur wp-content\plugins\paid-memberships-pro\languages\paid-memberships-pro-de_DE_formal.mo geladen.

    Alle Versuche, diese etwa nach wp-content\languages\plugins\paid-memberships-pro\ auszulagern und diese auch zu nutzen, schlugen fehl.

    Letzter Versuch, um die eigene Version der Datei aus wp-content\languages\plugins\paid-memberships-pro\ zu laden:

    add_action('load_textdomain', 'my_pmpro_trans_laden', 10, 2);
    function my_pmpro_trans_laden($txtdomain, $modatei)
    {
        if ('paid-memberships-pro' === $txtdomain && plugin_dir_path($modatei) === WP_PLUGIN_DIR.'/paid-memberships-pro/languages/')
        {
    load_textdomain('paid-memberships-pro', WP_LANG_DIR.'/plugins/paid-memberships-pro/'.$txtdomain.'-'.get_locale().'.mo');
       }
    }

    (Der Code ist natürlich in der functions.php des Childthemes)

    Entweder ist dieser, mein Code fehlerhaft oder ist euer Code in der localization.php eben nicht beeinflussbar?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Support Jarryd Long

    (@jarryd-long)

    Hi there, thank you for reaching out to the Paid Memberships Pro team.

    I’ve used Google Translate to translate your request below.

    How do you make your own translations update-safe?

    So I have to translate paid-memberships-pro-de_DE_formal.po (+mo) (locally for now, simply via Poedit) and outsource it so that it is not overwritten in the next update.
    (Unfortunately your instructions do not provide any information about this.)

    I have tried all common methods, but only wp-content\plugins\paid-memberships-pro\languages\paid-memberships-pro-de_DE_formal.mo is loaded.

    All attempts to move this to wp-content\languages\plugins\paid-memberships-pro\ and use it failed.

    Last attempt to load your own version of the file from wp-content\languages\plugins\paid-memberships-pro\:

    -- Code Here --

    (The code is of course in the functions.php of the child theme)

    Either my code is incorrect or your code in localization.php cannot be influenced?

    Your initial code recipe should work from what I can see. I would recommend unloading the existing textdomain using unload_textdomain( 'paid-memberships-pro' ); before loading your own and seeing if this helps.

    Kind Regards,
    Jarryd
    Support Manager at Paid Memberships Pro

    Thread Starter Anonymous User 22040435

    (@anonymized-22040435)

    Ich habe es versucht, aber egal wo und wie ich das unload_textdomain( 'paid-memberships-pro' ); in Kombination mit dem eingangs gezeigten Code einsetze: Es klappt nicht.
    Es entl?dt erwartungsgem?? jede andere Verwendung, auch eventuell in \wp-content\languages\plugins vorhandene und nimmt die Standardübersetzung aus dem WP_PLUGIN_DIR.'/paid-memberships-pro/languages/.

    Ja, man kann ja seine selber weiter übersetzten Dateien einfach nach \wp-content\languages\plugins kopieren, WP nimmt diese ja zuerst, wenn ich das richtig verstanden habe.
    Doch das ist ja auch nicht sicher vor Updates.
    Ergo gibt es (au?er mit dem Loco Plugin, das ich nicht mag) keine M?glichkeit, seine eigenen übersetzungen zu behalten. Au?er man sichert diese lokal und kopiert sie wieder zurück. Auch nicht elegant.

    Was nun?

    Thread Starter Anonymous User 22040435

    (@anonymized-22040435)

    Ich habe es (dank einer Anleitung) nun doch noch mal mit Loco Translate probiert: Das hat geklappt.
    Auch wenn es anders aussieht als in der Anleitung, Hauptsache, meine übersetzungen sind vor Updates sicher und werden von PMPro verwendet.

    Plugin Support Jarryd Long

    (@jarryd-long)

    I tried, but no matter where and how I unload_textdomain( 'paid-memberships-pro' ); in combination with the code shown at the beginning: It doesn't work.
    As expected, it unloads any other usage, including any existing ones in \wp-content\languages\plugins, and takes the default translation from the WP_PLUGIN_DIR.'/paid-memberships-pro/languages/.

    Yes, you can simply copy your own translated files to \wp-content\languages\plugins, WP takes these first, if I understood correctly.
    But that's not safe from updates.
    Ergo, there is no way (except with the Loco plugin, which I don't like) to keep your own translations. Unless you save them locally and copy them back again. Not elegant either.

    What now?

    For others reading this, the options around this are limited as the translation files that are loaded from GlotPress (.org) take preference over this. You would need to either upload your files to the /wp-content/languages folder however this doesn’t make them update safe, or use a localization plugin like Loco Translate to handle it.

    I tried it again with Loco Translate (thanks to instructions): It worked.
    Even if it looks different than in the instructions, the main thing is that my translations are safe from updates and are used by PMPro.

    Thank you for your feedback. I’m so glad to hear this is working for you. Feel free to reach out if there’s anything else we can assist with.

    Kind Regards,
    Jarryd
    Support Manager at Paid Memberships Pro

    Thread Starter Anonymous User 22040435

    (@anonymized-22040435)

    Wie gesagt, ich habe es nun mit Loco Translate soweit geschafft und die wichtigsten Strings auch in der DE Formal weiter übersetzt. Und die Datei als languages/loco/plugins/paid-memberships-pro-de_DE_formal.po gesichert.
    So weit, so gut.

    Nachtrag: Ich wurde von WP Support darauf hingewiesen, dass seltsamerweise mindestens eine weitere unvollst?ndige (DE Formal) Sprachdatei (mit nur 809 Strings) ins Verzeichnis wp-content/languages/plugins geladen wird. (manchmal auch mehrere!)
    (Die originale Sprachdatei in wp-content/plugins/paid-memberships-pro/… hat 3088 Strings.)

    Darf ich diese unerwünschten und unbrauchbaren Dateien einfach l?schen?

    Apart from Loco Translate, let’s forget that <– is not installed.
    If I install the Paid Memberships Pro plugin and have the website language set to German formal, then subsequently updates for the language are offered to install .

    Before the update, there was only a (German [formal]) language file in
    wp-content/plugins/paid-memberships-pro/languages/paid-memberships-pro-de_DE_formal.po with 3088 strings (over 1 MB)

    After the (german) language update there is an additional (and new) german language file in
    wp-content/languages/plugins/paid-memberships-pro-de_DE_formal.po with only 809 strings. (much smaller than 1 MB).

    The new file is damaged or whatever.

    Plugin Support Jarryd Long

    (@jarryd-long)

    @youngtimer

    As I said, I have now made it this far with Loco Translate and have continued to translate the most important strings in the DE formal. And saved the file as languages/loco/plugins/paid-memberships-pro-de_DE_formal.po.
    So far so good.

    Addendum: I was informed by WP Support that strangely at least one more incomplete (DE Formal) language file (with only 809 strings) is being loaded into the wp-content/languages/plugins directory. (sometimes several!)
    (The original language file in wp-content/plugins/paid-memberships-pro/… has 3088 strings.)

    Can I just delete these unwanted and useless files?

    You can delete them, they may come back after a language or core WP update however this will allow you to use your own translations and let them take preference.

    @la-geek Thank you for your feedback. This language files are managed by Glotpress (https://translate.www.ads-software.com/locale/de/default/wp-plugins/paid-memberships-pro/) and as such we don’t have control over which strings are published or released.

    If you have some time to spare, please consider contributing towards the public translations for your language as this can help you and other members of the community.

    More information about how you can contribute can be found at https://www.paidmembershipspro.com/paid-memberships-pro-in-your-language/#h-how-to-use-glotpress

    Kind Regards,
    Jarryd
    Support Manager at Paid Memberships Pro

    Thread Starter Anonymous User 22040435

    (@anonymized-22040435)

    Sie k?nnen sie l?schen

    Ok, danke.

    M?glicherweise werden sie nach einer Sprach- oder WP-Kernaktualisierung wiederhergestellt.

    Das glaube ich auch …

    Wenn Sie etwas Zeit erübrigen k?nnen..

    Also WP-Foren Mod @la-geek ist seit Jahren als übersetzerin t?tig. Und ihr habe ich zu verdanken, dass ich mich nun mit Loco Translate zurechtfinde usw. Danke!

    @jarryd-long

    Thank you for your feedback. This language files are managed by Glotpress

    That is wrong. Language files from translate.w.org are only rolled out, when they are translated at least to 90 %. And the english strings would be submitted completely. But in the damaged file (I mentioned above) are only a quarter of the english strings.

    More information about how you can contribute can be found at https://www.paidmembershipspro.com/paid-memberships-pro-in-your-language/#h-how-to-use-glotpress

    I have been GTE for German language for years, I know the processes.

    however this will allow you to use your own translations and let them take preference.

    No, how could you translate missing english strings?

    As an addition to my previous post above: I forgot to mention, that the damaged file is labeled with “100% translated” but it is only a quarter of the original translation file (120 KB)
    This is never the normal behavior or process of GlotPress/translate.w.org. Something is wrong in your plugin.

    You can see the content of this file there
    https://pastebin.com/aVHz4ZQ4

    Plugin Support Jarryd Long

    (@jarryd-long)

    @la-geek I appreciate your feedback. I hadn’t checked the status of that translation or seen how many strings were translated.

    All of our translation files are updated and contributed by the community though and if there are issues with the German translation we would of course like one of them to work properly.

    If @youngtimer would be interested in either contributing to the Glotpress version, or the version shipped with PMPro by contributing to it via Github, we would be grateful.

    Kind Regards,
    Jarryd
    Support Manager at Paid Memberships Pro

    @jarryd-long

    The problem was not caused by the community. The plugin code determines how and which language files are integrated. As I understand it, however, the bug is being searched for in the community, which makes it very easy for the plugin developer and so the bug will remain permanent.

    Whatever, since I don’t use WooCommerce and so no add-ons, this error does not affect me in any way. And so I couldn’t care less. I just wanted to be helpful and inform the plugin developer about it. Bye.

    Plugin Support Jarryd Long

    (@jarryd-long)

    @la-geek I appreciate your feedback. This question relates to Paid Memberships Pro, and not Woocommerce.

    I think we might be getting our lines crossed here though. Language files (even in the core plugin of Paid Memberships Pro) are contributed by community members – maybe not the same people contributing on GlotPress but people contribute to our language files (we don’t translate them ourselves).

    Weather it’s the language files shipped in the core Paid Memberships Pro plugin, or the GlotPress community translations, whichever one gets updated first will offer more translated strings to our users.

    Kind Regards,
    Jarryd
    Support Manager at Paid Memberships Pro

    @jarryd-long

    Not the language files are contributed by community members. The community members contribute translations.
    As said, GlotPress works so: When a plugin is translated to 90% GlotPress/translate.w.org rolls the language file out to the backend of the users. These files are located then under wp-content/languages/plugins/. But these files also are complete, says, they include 90% translation and 10% untranslated strings.

    The damaged file I mentioned is missing the untranslated strings.

Viewing 14 replies - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.