How to create translation ready theme WordPress? -
i in search of translating theme see themes in content shown _e('some text', 'textdomain');
tried poedit software failed. totally unable achieve while have been through these steps :( https://www.smashingmagazine.com/2011/12/internationalizing-localizing-wordpress-theme/
http://code.tutsplus.com/tutorials/translating-your-theme--wp-25014 still failed though provided info, can 1 guide in full detail or easy way achieve ? in advance
here how can in poedit software ? open poedit tool , go file > new catalog
provide desired info (project related info name etc)
then here info path in project catalog:
and here keywords (keywords want translate).
when done ok save project here note now:
note: have created languages
folder inside theme directory. means above info valid if placing .po
file inside languages folder.
so, once click on ok button, save file theme
name , ready go.
note2: in above example used theme
example purposes
can use ever project name or ever want.
now, come usage.
inside of theme file index.php or other page ever want use use in way.
<?php _e('here simple word', 'theme'); echo __('another word', 'theme');>
this above line example purposes can use ever want in real world thing like:
<h1>search results:</h1>
it become thing like
<h1><?php _e('search results', 'theme'); ?></h1>
in way become translation ready , can translated theme want .... !!!
if find issue in may solve issue placing below code inside functions.php
file.
add_action('after_setup_theme', 'my_theme_setup'); function my_theme_setup(){ load_theme_textdomain('theme', get_template_directory() . '/languages'); }
that's complete z details creating theme translation ready using poedit software.
note3: when ever add new code _e('my name kami', 'theme');
can check string inside poedit software clicking on update catalog button , string show there. can translate accordingly pressing alt + c
if still have confusion let me know ?
Comments
Post a Comment