Translate custom labels fields in function.php file of my theme

后端 未结 1 825
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-19 06:13

With the help from the community, I have succeeded to create, save and print the labels and their values to the single product page.

I can also translate the input

相关标签:
1条回答
  • 2021-01-19 06:45

    First, you should change the gettex domain name from 'woocommerce' to the domain name of your theme (or something more custom), as it doesn't make part of woocommerce code, and it's located in your active theme.

    1) the Free alternative:

    Then as it's not really content that you are trying to translate, but some peaces of code located in the function.php file of your active child theme (or active theme), you should use a specialized free plugin as Loco Translate that will provides in-browser editing of WordPress translation files.

    Loco Translate, also provides localization tools for developers, such as extracting strings and generating templates.

    Loco Translate features include:

    • Built-in translation editor within WordPress admin
    • Create and update language files directly in your theme or plugin
    • Extraction of translatable strings from your source code
    • Native MO file compilation without the need for Gettext on your system
    • Support for PO features including comments, references and plural forms
    • PO source view with clickable source code references
    • Protected language directory for saving custom translations
    • Configurable PO file backups
    • Built-in WordPress locale codes

    2) The commercial complete way (completely compatible with WooCommerce):

    The most complete commercial alternative is WPML plugin, that will also handle perfectly and more easily WooCommerce custom localisation and translations content for multilingual web sites. The other free optional plugins are incomplete for WooCommerce and much more difficult to get them work totally well.

    So If you are planing to publish a multilingual website, think about it.

    0 讨论(0)
提交回复
热议问题