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

巧了我就是萌 提交于 2019-12-01 20:53:34

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!