Translation & RTL

Translation

 

1. Make a new translation from Parent theme

UNIDASH is a WMPL-compatible and multi-language-ready theme. To translate this theme:

  • Download and install this tool POEdit
  • Open POEdit and load [/unidash/languages/unidash.po]
  • Translate the text and save the file
  • A file named unidash.mo is created. Save it in /unidash/languages/ folder. Rename it with Code Name of your language. For example, de_DE.mo for German – Deutsche. See language code list here http://codex.wordpress.org/WordPress_in_Your_Language
  • For WordPress 4.0 and above, go to Settings > General and choose Site Language

2. Translate from Child theme.

Translating theme from child theme help you keep the translated language file when updating theme. So you can feel free to update theme without losing the translation.

  • Copy the language folder from themes\unidash to themes\unidash-child
  • Make a new translation follow the above steps.
  • Copy this code to themes\unidash-child\functions.php, in which unidash‘ is the text domain of UNIDASH theme
/* Loads the child theme textdomain. */
function wpdocs_child_theme_setup() { 
load_child_theme_textdomain( 'unidash', get_stylesheet_directory() . '/languages' ); }
add_action( 'after_setup_theme', 'wpdocs_child_theme_setup' );
  • Save the functions.php file.
  • For WordPress 4.0 and above, go to Settings > General and choose Site Language

3. Update an Older Translation

  • Copy your existing Custom Language folder from your current theme version to the updated version’s Language folder.
  • Open your old existing .pot file in Poedit
  • Choose Catalog > Update from POT file from the menu and select your new unidash.pot file
  • The catalog will then be auto updated with all the new text strings, and your custom ones will be preserved.
  • Save your updated .pot file

 

RTL

UNIDASH also supports RTL – Right To Left languages. The remarkable is that if your wordpress language (in Settings> General > Site Language)  is an RTL language, the theme will recognize it and turns theme’s direction to RTL automatically. So you don’t need to change any option.