• Hi
    I have followed the steps about “Internationalisation” on the wordpress codex page.

    To internationalize a child theme follow these steps:

    1. Add a languages directory.
      Something like my-theme/languages/.
    2. Add language files.
      Your filenames have to be he_IL.po & he_IL.mo (depending on your language), unlike plugin files which are domain-he_IL.xx.
    3. Load a textdomain.
      Use load_child_theme_textdomain() in functions.php during the after_setup_theme action. The text domain defined in load_child_theme_textdomain() should be used to translate all strings in the child theme.
    4. Use GetText functions to add i18n support for your strings.

    What about the last step about using getText functions.
    Please give me an example about using the getText function and where should I put these strings?

Viewing 1 replies (of 1 total)
  • gettext functions are used to wrap your text so WordPress knows what should be translated. For example, if you were to write: “Hello World!” as some text in your theme, how would WordPress know that you want to translate this string? Consider the code example taken from Child Themes Codex:

    <?php
    _e( 'Code is Poetry', 'my-child-theme' );
    ?>

    With the help of function _e(), you made the string Code is Poetry translatable. _e() Function Reference

Viewing 1 replies (of 1 total)
  • The topic ‘Child theme translations’ is closed to new replies.