Comments

blueminds’s picture

Status: Active » Needs review
StatusFileSize
new6.61 KB

Here is the documentation.

I think the code does not need any changes. We do not need explicitly naming the method params to be local/remote as in the core we pass into methods only local codes.

miro_dietiker’s picture

Status: Needs review » Needs work

Nice improvement. Some work needed here. :-)

+++ b/tmgmt.api.phpundefined
@@ -174,3 +174,59 @@ function hook_tmgmt_translator_plugin_info_alter(&$info) {
+ * Each tmgmt plugin is implicitly expected to support this feature. However for

Implicitly expected to support?

It is implicitly supported through default implementation. The only question is if the plugin enables the mapping throgh settings.

+++ b/tmgmt.api.phpundefined
@@ -174,3 +174,59 @@ function hook_tmgmt_translator_plugin_info_alter(&$info) {
+ *   TMGMTTranslator entity. These are convenient methods.

convenience

+++ b/tmgmt.api.phpundefined
@@ -174,3 +174,59 @@ function hook_tmgmt_translator_plugin_info_alter(&$info) {
+ * - getDefaultRemoteLanguagesMappings() - we might know some mapping pairs
+ *   prior to configuring a plugin, this is the place where we can define these
+ *   mappings. The default implementation returns an empty array.

Here i guess, default mapping should also provide mappings for fallback cases.

berdir’s picture

The plugin needs to explicitly support language mappings and we expect it to do so, that's what that sentence means. Agreed that it could use some rewording.

Not sure I understand the last point.

berdir’s picture

The plugin needs to explicitly support language mappings and we expect it to do so, that's what that sentence means. Agreed that it could use some rewording.

Not sure I understand the last point.

miro_dietiker’s picture

What i mean is:
We should state that DefaultMapping should also try to be nice and offer mappings for the available Drupal languages...
In concrete trying to match de to remote de-DE and so on.
And considering even local country for anything to anything-COUNTRY and so on.

Or document where these fallbacks should be applied right.

berdir’s picture

That's not the place for that, that function only returns an array of default mappings you can't implement fallback logic there, you need to override mapToRemoteLanguage()/mapToLocalLanguage() for that.

Also think that some of the methods themself should be improved a bit, possibly instead of having too much information in here.

I'll try to revise this a bit today if martin isn't already working on it.

blueminds’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new7.28 KB

Fixed comments, added a few more comments.

Not sure what you mean by improving methods. But if we want to do any code changes let's do in followup as this is about documentation.

Also reviewed translators:
- gengo - fully implemented
- oht - #1999992: Update remote languages mappings logic work in progress
- supertext - #2000000: Update remote languages mappings logic work in progress
- nativy, google, bing - not yet started

So question is how much effort we want to invest into pushing this feature into the translators. But sure we can discuss in the specific translator issues so that we can close this to not block release.

berdir’s picture

Title: Document the remote languages mapping logic and revise plugins to follow the standard » Revise/track translator plugins to follow the language mapping standard
Status: Needs review » Active

"I'll try to revise this a bit today if martin isn't already working on it.". Famous last words :)

New patch looks good to me, agreed that any code changes should happen in separate issues.

Keeping this open for now to track translator progress, though.

Here's the result: http://api.worldempire.ch/api/tmgmt/tmgmt.api.php/group/tmgmt_remote_lan...

miro_dietiker’s picture

Issue tags: +8.x release target