Support » Plugin: Sublanguage » Need Improvement

  • I’m searching multilanguage pluging to use my own site for a while.. I tried lots of plugins to find SEO friendly & user friendly but nothing I found… This plugin meets to lots criteria for SEO, especially URL format but it needs to develop more. Here’re my notes:

    1. It has to use hreflang metatag. For more information: https://moz.com/learn/seo/hreflang-tag

    2. It needs to translate metatag title and description for each post and each language feauture.. May be you can support to yoast SEO plugin (because its the most populer plugin)

    3. I’m not sure but we should translate to menu items (theme feature), tags etc.

    4. Can we add country flags to navigate other languages? ๐Ÿ™‚

    Thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author maximeschoeni

    (@maximeschoeni)

    Hello Uggur,

    Thank you for this review. I’ll try to reply point by point.

    1. This is a great idea. I am going to implement this in the next release.

    2. Unfortunately for now the admin interface wp-admin/options-general.php don’t allow to plug in to add custom fields, and I don’t want to hack into with jQuery injection, because it is buggy and hard to maintain. So this is the solution I’d recommend:

    First add this into your function.php:

    if (!is_admin()) {
    	  add_filter('option_blogdescription', 'my_translate_option_field');
    	  add_filter('option_blogname', 'my_translate_option_field');
     }
    
    function my_translate_option_field($value) {
    
    	return apply_filters('sublanguage_custom_translate', $value, 'my_custom_language_parser');
    
    }
    
    function my_custom_language_parser($original, $language) {
    
    	if (preg_match('/\[:'.$language->post_name.'\]([^[]*)/', $original, $matches)) {
    
    		return $matches[1];
    
    	}
    
    	return $original;
    
    }

    And in the wordpress general settings page (wp-admin/options-general.php), into “Site Title” and “description” field, write something like this: [:en]My Wonderfull Site[:fr]Mon super site[:es]Mi sรบper Sitio.

    Now for the yoast SEO plugin, here is a walkthrough to make it translatable, based on the same idea:

    Add this into function.php:

    if (!is_admin()) {
    
    	add_filter('option_wpseo', 'my_wpseo_option');
    	add_filter('option_wpseo_titles', 'my_wpseo_option');
    	add_filter('option_wpseo_social', 'my_wpseo_option');
    
    }
    
    function my_wpseo_option($value) {
    
    	foreach ($value as $key => $val) {
    
    		$value[$key] = apply_filters('sublanguage_custom_translate', $val, 'my_custom_language_parser');
    
    	}
    
    	return $value;
    
    }
    
    function my_custom_language_parser($original, $language) {
    
    	if (preg_match('/\[:'.$language->post_name.'\]([^[]*)/', $original, $matches)) {
    
    		return $matches[1];
    
    	}
    
    	return $original;
    
    }

    And use the same way as before to translate fields. For example: Meta description template: [:en]English text[:fr]Texte franรงais[:es]texto espaรฑol

    3. Can you precise this question, I am not sure to understand this point…

    4. Sorry, I’m not going to add country flags into plugin. It’s too much work to update and actually it’s easy enough to do this through CSS.

    Hi Maxi ๐Ÿ™‚

    1. I’m waiting with impatiently to next release ๐Ÿ™‚ Because this the most important thing for multilanguage SEO..

    2. I’ll try. And It’s also important too content language based metatag datas for post, categories and pages.. Maybe you can add custom fields for posts, pages and categories to define content based metatags.

    3. For exp my theme uses custom menu. I created menu from themes > menu in wp-admin, it appears in my themes header. My main language is Turkish and I created TR menu; but for english version of posts menu also Turkish. Besides I added tags to post which language is Turkish, It also appears in English version too..

    So I need to define content language based custom menu and tags ๐Ÿ™‚

    4. Okey ๐Ÿ™‚ But it would be easier for users if plugin had this feature..

    Plugin Author maximeschoeni

    (@maximeschoeni)

    1. Ok, i’ll do it asap

    2. Sorry I searched for a solution but I could not find one. I’ll try again later.

    3. Sorry this plugin cannot yet translate the menu items name, title attributes and description. You can use menus but you must stick with the default page/post/tags/category title for items name.

    This plugin intends to translate sites that are structurally the same in all languages. So its a bit tricky to display taxonomy stuffs in one language and not in another. But why not just translate tags?

    4. If you feel so you can make a third-hand plugin to bring this feature ๐Ÿ˜‰

    Plugin Author maximeschoeni

    (@maximeschoeni)

    I just released the 1.4.5 version of Sublanguage. I added the feature you suggested with the hreflang metatag and corrected some flaw with postmeta. Now you should be able to translate the Yoast SEO plugin metatag datas for post. Just add this in your function.php:

    add_filter('sublanguage_register_postmeta_key', 'my_translate_postmeta');
    
    function my_translate_postmeta($postmeta_keys) {
    
    	$postmeta_keys[] = '_yoast_wpseo_title';
    	$postmeta_keys[] = '_yoast_wpseo_metadesc';
    	$postmeta_keys[] = '_yoast_wpseo_opengraph-title';
    	$postmeta_keys[] = '_yoast_wpseo_opengraph-description';
    	$postmeta_keys[] = '_yoast_wpseo_twitter-title';
    	$postmeta_keys[] = '_yoast_wpseo_twitter-description';
    
        return $postmeta_keys;
    
    }

    Thank you maxi ๐Ÿ™‚ You’re the number one! I’ll examine it today..

    The first my note is, alternate metatag is not necessary for point to itself. For example If I’m in EN version of the post, I need to see just alternative languages post has in the metatags; not itself.

    Also I can translate your plugin to Turkish If you want. Just send me your pot file ๐Ÿ™‚

    Plugin Author maximeschoeni

    (@maximeschoeni)

    You’re welcome!

    Are you sure about metatag not pointing to itself? Maybe I misinterpreted this explanation on the page you gave me, but it seams quite clear to me…

    The hreflang tag on each page should include a reference to itself as well as to all the pages that serve as alternates for it. If your Spanish website sells Iberian ham to customers in Spain, France, and Portugal only, the hreflang tags for your homepage might look like this:

    <link rel="alternate" href="example.com" hreflang="es-es" />
    <link rel="alternate" href="example.com/fr/" hreflang="fr-fr" />
    <link rel="alternate" href="example.com/pt/" hreflang="pt-pt" />

    Thank you for your proposition for translation. You’ll find a .po file in the language directory of the plugin. However Please note I am no native english speaker and the original text is probably poor english ๐Ÿ™

    Ohh yes you’re right, my memory has misled me. So there is no problem with pointing to itself: https://support.google.com/webmasters/answer/189077?hl=en

    No problem, I’ll translate for you. How can I send file to you; could you please give me ur mail address? ๐Ÿ™‚

    Plugin Author maximeschoeni

    (@maximeschoeni)

    of course, here is my address: contact@maximeschoeni.ch

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Need Improvement’ is closed to new replies.