Is there some ways to autofix the mo or po files instantly?
Is there some ways to autofix the mo or po files instantly?
Is there some ways to autofix the mo or po files instantly?
i think you need the gettext filter. lifted directly from the codex, here is an example: add_filter( ‘gettext’, ‘theme_change_comment_field_names’, 20, 3 ); /** * Change comment form default field names. * * @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext */ function theme_change_comment_field_names( $translated_text, $text, $domain ) { if ( is_singular() ) { switch ( $translated_text ) { case ‘Name’ : … Read more
If dont use the strings inside the theme or plugin the function for localisation, then it is not possible to add this to the mo/po file. You must change the source of the theme or plugin. But used the theme or plugin the functions, than parse the source via plugin or desktop tools to add … Read more
First make sure the language file is found. In your development environment (and only there!) add the following code: $path = plugin_dir_path( __FILE__ ) . ‘lang’; $loaded = load_plugin_textdomain( ‘LSample’, false, dirname( $path ); if ( ! $loaded ) { print “File not found: $path”; exit; } Then … I would use lowercase text domains … Read more
.po and .mo files are created by the translator himself, and then contain the actuall translation, so if you do not supply a translation with your theme then you don’t need them. .pot file is basically a template for the .po file. you can easily generate it with tools like poedit but IMO it is … Read more
Locale comes from WPLANG constant defined in wp-config.php. In the last version of WordPress (4.0, maybe 3.9) something is changing. You can install more languages setting WPLANG to different locale. Then you can select the language in the backend from Settings > General > Site language and set locale in the header. It seems that … Read more
It had to do with the file path for the required items I found an answer at this location that got it to work: https://stackoverflow.com/questions/5647075/fatal-error-require-once-function-require-failed-opening-required
If you want to use load_textdomain you must also specify the file name: function my_custom_locale() { load_textdomain(‘my-name’, get_stylesheet_directory().’/languages/my-name- ‘.get_locale().’.mo’); } add_action(‘after_setup_theme’, ‘my_custom_locale’); In my example I added custom translations used in additional template files placed inside the theme-child folder, where I also added the languages files folder (es. my-name-it_IT.mo, my-name-en_GB.mo). I added the code in … Read more
Disclaimer This is not a complete answer, because I can’t really handle signs I don’t know. It should help to point you in the right direction. My (basic) solution Taken from StackExchange, I created this function for your functions.php: function ArabicDate( $time = false ) { if ( $time === false ) { $time = … Read more
You can wrap the translation in a printf function. printf ( or sprintf for when you don’t want to print to the screen immediately ) allow you to put placeholders in the string. See the documentation for all the type specifiers Use __() instead of _e() because printf already outputs to the screen. $no_people = … Read more