WordPress.org

Ready to get started?Download WordPress

Forums

How to easily translate frontend language strings? (6 posts)

  1. Paal Joachim Romdahl
    Member
    Posted 1 year ago #

    I did some searching online.

    I would like to find an easy to to translate frontend language strings from English to Norwegian. Easy is the keyword here.

    Using the Norwegian WordPress language files the backend becomes Norwegian but I did not notice any difference in the theme on the frontend that I am using.

    I also just want to replace words as Search, reply to etc.
    I am working on finding a simple solution to replacing the text strings on the frontend.

    Got any ideas?
    Are developers for WordPress Core making it easier for the developer to change text strings to other languages?

  2. keesiemeijer
    moderator
    Posted 1 year ago #

    It depends if your theme is translation ready. http://codex.wordpress.org/Translating_WordPress

    To translate plugins and themes I use this plugin: http://wordpress.org/extend/plugins/codestyling-localization/
    It can scan WordPress/plugin/theme for all translatable strings and create the po and .mo translation files.

    tutorial

  3. Rev. Voodoo
    Volunteer Moderator
    Posted 1 year ago #

    First up, is the theme translatable? The theme would need to be ready, or you need to get your hands dirty (very dirty) setting that up.

    http://codex.wordpress.org/Translating_WordPress
    As I'm not sure what you've read.. here's a start

    Essentially, translating the back and front ends are 2 different processes

    Take a look at the links at the bottom of that codex entry to start getting into the theme end of things

  4. Paal Joachim Romdahl
    Member
    Posted 1 year ago #

    This is how I understand it.

    First switch to the language file name in wp-config:
    Replace define('WPLANG', ''); with (example here is Norwegian) -> define('WPLANG', 'nb_NO');

    Dashboard > Updates and then run the language file.

    The backend changed to Norwegian. The frontend stayed the same (checked the Leave a Reply).... I thought it would change when changing languages...?
    I found the theme I use on the localization page clicked to edit the theme and added some Norwegian words to the most common English words. Leave a reply was changed among other words. Clicked generate Mo file. Went to the frontend and refreshed the page. No change.

    I installed the plugin Codestyling Localization. The Pot and Mo areas for Norwegian are both in green.

    What am I doing wrong?

  5. keesiemeijer
    moderator
    Posted 1 year ago #

    I installed the plugin Codestyling Localization. The Pot and Mo areas for Norwegian are both in green.

    Check if the language files are in your theme folder by using FTP or whatever file management application your host provides.

    Maybe your theme doesn't load the text domain correctly:
    http://codex.wordpress.org/Function_Reference/load_theme_textdomain

    Try looking for load_theme_textdomain() in your theme's functions.php

  6. Paal Joachim Romdahl
    Member
    Posted 1 year ago #

    I noticed the Po and Mo files had a wrong file name so I readjusted to the correct name and the front end changed.

    My frontend and backend are now in Norwegian. Since I wanted to change the backend to English I installed Bogo http://wordpress.org/extend/plugins/bogo/
    It will easily switch the backend to English. Bogo can also make translation pages. So I created an English page along with the Norwegian.

    The question that comes up is:
    Switching between multiple frontend language pages will it reflect with the theme text strings? Meaning having Norwegian on the Frontend the theme text strings (the ones I translated) have then changed to Norwegian. BUT switching language is there a way to have the theme language switch back again to English?

    Thank you for all your comments!

Topic Closed

This topic has been closed to new replies.

About this Topic