Keywords WPML
-
Hello,
I have a little problem in my website.
I use this plugin: Add Meta Tags – and language plugin WPML.
Meta tags work perfect for main language, for each subpage i create own keywords and it works okey. But if i put another keywords for other language on header i can see keywords standard keywords + keywords from main language.I want to make just other keywords for other languages.
How can i make it?
-
But if i put another keywords for other language on header i can see keywords standard keywords + keywords from main language.
I want to make just other keywords for other languages.
How can i make it?Hi, I’m having a hard time understanding the problem here. Maybe this is because I don;t know how WPML works. Could you please provide more information?
Marking the topic as resolved until more feedback is available. Besides, WPML is not a free plugin, so it is difficult to test. Feel free to reopen the topic.
I can help with testing WPML, if you’d like too.
I can report that in my site, which has a static front page, i get: the global keywords are displayed independently of the language, but the post keywords are of course only displayed for the post/page itself, as well as the post/page description. (This is fine for my personal use, but not ideal for multilanguage.)
To make Add Meta Tags truly multilaguage, you would have to provide integration with the multi-language admin that WPML implements. For example: ideally, Add Meta would provide a way to indicate different global keywords according to the language, and also different copyright URLs, and any other information that changes with language. This is done with WPML.
WPML seems to have a policy of working together with plugin authors. If you are interested, please have a look: https://wpml.org/documentation/theme-compatibility/go-global-program/
Read the program – they will set up a site for you for testing, and provide you with an account in their organization so you can download the plugin.
Thanks for all the information. WPML is a respected commercial plugin and it sounds interesting. However, adding support for a specific 3rd party plugin, especially for a commercial product like WPML that does not even have a lite version available for free, is possibly outside the scope of the Add-Meta-Tags development.
Nevertheless, there are still many workarounds. For example, as far as the general settings, such as the ‘Site Description’, ‘Site Keywords’, and ‘Global Keywords’ are concerned, a filter hook could be added for each one of them, so as to be able to change them programmatically for any additional languages. I know that such a solution is not very user-friendly, but it is the only one that is close to the goals of this plugin.
From what I understand, when WPML is used, the custom description & keywords that can be set in the post editing screen, can be set separately for each of the supported languages. Is this correct? The only issue is the general settings like the ‘Global Keywords’?
By using a workaround like the one I mentioned above, the global keywords could pass through a filtering function, which would set them according to the used language. For example:
function amt_get_global_keywords( $default ) { $current_lang = X_GET_THE_WPML_LANG_HERE(); if ( $current_lang == 'pt-BR' ){ return 'pt-br-global-keyword1, pt-br-global-keyword2, pt-br-global-keyword3'; } elseif ( $current_lang == 'de-DE' ){ return 'de-global-keyword1, de-global-keyword2, de-global-keyword3'; } // ..etc.. return $default; } add_filter( 'amt_some_global_keyword_hook', 'amt_get_global_keywords' );
That way it would be independent of the plugin that adss the miltilingual support to wordpress and give more flexibility to the user/developer.
Please let me know if I am missing anything here…
George
I’ll need to do some thorough research about WPML. In case this information is needed in order to set it up with the Custom Fields that are used by Add-Meta-Tags, here is a list with their names: https://www.codetrax.org/projects/wp-add-meta-tags/wiki/Data_Storage#Custom-Fields
I’m definitely interested in making the plugin work with multilingual plugins.
George
As a test, I tried qTranslate-X and I noticed that the ‘Metadata’ metabox fields (custom description/keywords/title/etc) are the same for all languages, which means we have a problem some further integration with multilingual plugins should be implemented.
I also found the babble plugin, by Automattic. I’ve taken a note to test this one as well.
Also, I’ll consider checking the WPML’s ‘go-global-program’.
George
I completely understand if you decide their go-global program is out of the development scope, for the reasons you mentioned. And even if you’d decide for it, we know it would take time.
Regarding the post description and keywords, yes, WPML treats each post translation as a different post, so there’s no need to worry about that, i think (keep in mind i’m not a programmer). The Metadata box for a translation starts empty, it doesn’t share the original post’s metadata.
The site description and title are also handled by WPML: there’s a different setting for each language. One accesses each one as the language of the WP admin panel is changed. It looks like Add Meta Tags is fine with that, because i have different site descriptions for the different languages in my site right now.
What you found out about qTranslate is what made me quit using it and choosing WPML.I understand the code you posted, thanks a lot! I am not using it, because my global keywords are “language independent”, actually. I am sure the code will help people landing here.
I didn’t know about babble, it wasn’t available when i started translating my site in the past. Being published by Automattic, it can be a reliable way ahead. I’d just sugest that any adaptations you make in the future take WPML into account, just not to become incompatible.
Thank you one more time!
EduardoRegarding the post description and keywords, yes, WPML treats each post translation as a different post, so there’s no need to worry about that, i think (keep in mind i’m not a programmer). The Metadata box for a translation starts empty, it doesn’t share the original post’s metadata.
The site description and title are also handled by WPML: there’s a different setting for each language. One accesses each one as the language of the WP admin panel is changed. It looks like Add Meta Tags is fine with that, because i have different site descriptions for the different languages in my site right now.I’m truly grateful for this feedback, because currently I cannot test WPML.
Time permitting I’ll enroll to the WPML program you mentioned above and test it myself soon. From what I see, WPML is the top player in the multilingual area of plugins.
BTW, the code I posted above does not currently work, because the filter hook has not been implemented yet. I scheduled it for the immediate next release.
The babble plugin is not mature enough yet. From what I see it exists only on github. Apart from qtranslate-X I also tested polylang, which is also a good plugin.
The conclusion I’ve reached after testing these plugins is that the custom fields (custom description, keywords, news keywords, etc) are supported with minimal or no extra configuration on those plugins.
The problem is the
global keywords
, thesite description
and thesite keywords
of the general plugin settings page. Since all settings of add-meta-tags are stored in a single wordpress options (this was the best practice and possibly this still stands), it would be very difficult for any multilingual plugin to find this data and offer translation capability for it. So, the only way this is going to work is with code similar to that I posted above.About WPML, there should be no worries. From what I see, becoming incompatible is not even a possibility. ??
George
I’m happy to report that this meta tag:
<meta itemprop="inLanguage" content="en_US" />
Is being generated correctly by Add Meta Tags in conjunction with WPML, consistent with the post language.This is actually the work of WPML. Add-Meta-Tags uses the WP API. WPML modifies the WP API in a way so that any API calls return the value according to the current language. So, everything works.
Also I think the following page from the WPML docs will help me add support for WPML, even the settings that exist in the options array, like site description, site keywords and global keywords.
https://wpml.org/documentation/support/language-configuration-files/
Optional for everyone reading this topic.
Uploaded a
wpml-config.xml
file on the dev site.Should be placed in the root directory of the add-meta-tags plugin (
/wp-content/plugins/add-meta-tags/
).This is the same config file that will ship with v2.8.9.
It adds full support for the translatable global Add-Meta-Tags settings (site description, site keywords, global keywords, copyright url) and also support for the custom fields used by add-meta-tags to store post specific data, like custom description, keywords, title, etc.
Supported plugins: WPML, Polylang.
Also in my TODO list for testing: qTranslate-X, babble.
George
Thanks a lot, George, that is nice.
Another observation:
If one has images in a post or page, Add Meta Tags will generate ImageObject scopes. The “name” in these will be the title of the media, as defined in the WP midia library, it seems. First, i could not find a way to translate those with WPML.
Then i remembered that Images are stored just like posts, and have their own URLs. So, if one goes to the attachment page, and click on Edit Midia in the admin bar, he will be taken to the Edit Midia page. At the bottom there will be an option inserted by WPML that you can check and save to Make Midia Translatable. You will have to upload the midia file again, and enter the translated text.I am not testing that for now, but i would guess that Add Meta Tags will get the translated midia name for the translated post, because of the way WPML modifies the API like you explained above.
Hello Eduardo,
I found this: https://wpml.org/documentation/getting-started-guide/media-translation/
I am not testing that for now, but i would guess that Add Meta Tags will get the translated midia name for the translated post, because of the way WPML modifies the API like you explained above.
Normally yes. WPML creates a new post object for every translation. Regarding attachments, it might or might not duplicate the attachment file. In any case, any WP API calls used by Add-Meta-Tags should return the properly translated value or the proper URLs to the attached media.
If you notice anything unusual, please let me know about it.
Unfortunately, I cannot test WPML myself at this time, but I’ll see what I can do about this in the near future.
George
- The topic ‘Keywords WPML’ is closed to new replies.