The error:
localize.drupal.org "Not allowed to submit translations in this language."

The error occurs after translate a string to German with the Localization client.

Drupal 7.14
API key correct installed.
I'm member of the German user group.

I guess I'm not alone with this error.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Gábor Hojtsy’s picture

You can submit translations to German on the localize.drupal.org user interface itself? (Being a member of a group does not in itself guarantee you actually have permissions in the group).

quiptime’s picture

Currently I have 55 approved German translations. All realized with the webinterface of localize.drupal.org.

(Being a member of a group does not in itself guarantee you actually have permissions in the group).

How get informations about my permissions of a language group?

My localize.drupal.org account not contain such information.

Gábor Hojtsy’s picture

My question was not whether you have been able to submit translations before. Can you please try and answer my question?

quiptime’s picture

You can submit translations to German on the localize.drupal.org user interface itself?

Yes I can.
See

Currently I have 55 approved German translations. All realized with the webinterface of localize.drupal.org.

Gábor Hojtsy’s picture

Status: Active » Postponed (maintainer needs more info)

What I pointed out is that you have previously submitted translations is not indicative of whether you can currently do that, right? That statement did not help me understand whether you can currently submit translations. Whatever.

Have you been able to submit translations *earlier* using the l10n_client module, and it suddenly stopped working or is this a fresh setup? Do you have permission to submit to any other groups, and can you submit translations there? (Feel free to join the test language group to test, if you don't want to leave useless testing contributions around).

quiptime’s picture

No, there is no previous use of l10n client.
I work on fresh setup (since 3 days).

Test-language group?
How can find a hint to join the test-language group?

Gábor Hojtsy’s picture

UrmasZ’s picture

Same problem here translating into estonian.
I am member of Estonian team group.
API key is correct.

I can translate without errors using http://localize.drupal.org/translate/languages/et/translate. I can translate my site without errors using Drupal's translating system. And I can translate my site using Localization Client, but it gives me mentioned error by quiptime.

It was working some time ago, but not now. Not working a month or something like that. Can't remember exactly. And I know, we are not the only ones that have this problem.

I have patched my Localization Client installation with http://drupal.org/node/1026048. Not sure, if this is the reason or not. :D Quiptime, are you using this patch also?

quiptime’s picture

@UrmasZ,

no. I'm not using the patch.

Gábor Hojtsy’s picture

This is becoming interesting :) I don't know of any changes on the server that should have made this happen (and have not heard about this report before, so UrmasZ's confirmation is good). I'll try to ask Sebastien to look at this.

UrmasZ’s picture

Gábor Hojtsy, if you translate something with localization client, you have no errors?

Gábor Hojtsy’s picture

Status: Postponed (maintainer needs more info) » Active
lsolesen’s picture

I can confirm that I am able to save a translation on http://localize.drupal.org/translate/languages/da/translate?project=&sta..., but is also rejected. For Danish translations.

Thomas_Zahreddin’s picture

FileSize
7.94 KB

hi,

i checked the rights of user quiptime (since he wrote me a e-mail in the beginning of this issue):
he has (since a long time) the role translation team member
-> we tested that quiptime is able to add translation suggestions via web-interface (works).

So the rights should be sufficient, and he added also suggestions via web-interface in the last week.
(So i think the permissions are ok, which we tested first).

(I do not use the localization client, so i have no expirience with this module).

Gábor Hojtsy’s picture

Ok I looked into the module code and seems like we'd not get a better idea from looking at watchdog logged response information either: http://drupalcode.org/project/l10n_client.git/blob/refs/heads/7.x-1.x:/l... (the same message is printed to the user). I also verified the module is turned on on localize.drupal.org to handle the remote submissions (plus you would not get this error if it would not be enabled anyway).

Then looked at the code for the l10n_remote module, and where this error is reached. See http://drupalcode.org/project/l10n_server.git/blob/refs/heads/6.x-3.x:/l... - at this point your user token is checked and various higher level permissions are checked. This permission check is done after the group context is set to check your permissions. So looks like that group context is not properly set. I'm wondering what happened there, since I have not seen any updated to the l10n_groups module either that does a similar groups context setting when in the web UI, so if you are allowed to submit things there, you should still be able to submit strings here. However, it is not the exact same code, so there is still the possibility that something changed in og user roles or og that would need to be updated here.

That is all I found so far.

Gábor Hojtsy’s picture

@sebcorbin tracked it down further to this l.d.o watchdog entry: Warning: Parameter 1 to og_user_roles_grant_roles() expected to be a reference, value given in module_invoke() (line 461 of /var/www/localize.drupal.org/htdocs_bzr/includes/module.inc)., which is directly related to the l10n_remote code I pasted above, which uses module_invoke(). It was merely done to avoid doing a function_exists() (or module_exists()) wrapper around this code.

Drupal.org servers were recently updated to PHP 5.3, that is the underlying reason for us now getting this error. @sebcorbin is looking to provide a patch.

SebCorbin’s picture

Project: Localization client » Localization server
Version: 7.x-1.1 » 6.x-3.x-dev
Assigned: Unassigned » SebCorbin
Status: Active » Needs review
FileSize
755 bytes
SebCorbin’s picture

FileSize
735 bytes

woops

Gábor Hojtsy’s picture

Status: Needs review » Needs work

Well, the problem is down in the code, not exactly there. I'd do something like:

BEFORE:
 147  // Attempt to set group context with l10n_groups, if that module is available.
 146   module_invoke('l10n_groups', 'set_context', $langcode);
 147   // If og is enabled and group node is set, invoke user role update, so the
 148   // following user_access() call will properly see the access permissions.
 149   if ($group_node = module_invoke('og', 'get_group_context')) {
 150     module_invoke('og_user_roles', 'grant_roles', $account, $group_node);
 151   }
AFTER:
 146  if (module_exists('l10n_groups')) {
 147     // Attempt to set group context with l10n_groups, if that module is available.
 146     l10n_groups_set_context($langcode);
 147     // If og is enabled and group node is set, invoke user role update, so the
 148     // following user_access() call will properly see the access permissions.
 149     if ($group_node = og_get_group_context()) {
 150       og_user_roles_grant_roles($account, $group_node);
 151     }
 152  }

That is getting rid of the module invoke's in favor of a module_exists() wrapper (that in itself should already ensure og user groups and ogur exists?). If ogur is not a direct requirement of l10n_groups, then function_exists() there too before invoking it. We need to directly invoke it, so arguments are taken by reference as needed.

SebCorbin’s picture

Status: Needs work » Needs review
FileSize
1.14 KB
quiptime’s picture

No reviewers available?

Sahin’s picture

FYI, we in Turkish group get the same error messages while sending translations by Localization client although can translate on the server without a problem.
But this comment is about another strange thing that happened some time ago, though cannot remember the exact date:
More than a thousand new Turkish suggestions (re)appeared out of the blue, while this number was only 3 a while ago. All of these translation suggestions are dated old, and I can clearly remember at least some of them were declined before.
I do not know the reason and am not sure whether this is related with the mentioned php update, but maybe can give a hint.

Sutharsan’s picture

#20 patch is code like as suggested by Gábor. No code style problems found. I have not tested the code and therefore I don't want to put it on RTBC myself.

PROMES’s picture

subscribe

droplet’s picture

Testing locally without patch and works fine. what's the LDO module version ?

my list:

 Localization server             Localization community UI (l10n_community)     Module              
 Localization server             Localization packager (l10n_packager)          Module              
 Localization server             Localization remote API (l10n_remote)          Module              
 Localization server             Localization server (l10n_server)              Module              
 Localization server connectors  Localization server for Drupal (l10n_drupal)   Module              
 Messaging                       Messaging (messaging)                          Module  6.x-2.4     
 Multilanguage                   Translation template extractor (potx)          Module  6.x-3.x-dev 
 Notifications                   Content Notifications (notifications_content)  Module  6.x-2.3     
 Notifications                   Notifications (notifications)                  Module  6.x-2.3     
 Notifications                   Notifications Lite (notifications_lite)        Module  6.x-2.3     
 Organic groups                  Organic groups (og)                            Module  6.x-2.4     
 Organic groups                  Organic groups user roles (og_user_roles)      Module  6.x-4.1     
 Organic groups                  Organic groups Views integration (og_views)    Module  6.x-2.4     
 Other                           Token (token)                                  Module  6.x-1.18    
 User interface                  jQuery Update (jquery_update)                  Module  6.x-2.x-dev 
 Views                           Views (views)                                  Module  6.x-2.16    
 Views                           Views UI (views_ui)                            Module  6.x-2.16

** Localization server (git 6.x-3.x)

DuaelFr’s picture

Same issue with my French translations but I cannot review patches as I have no translation server installed...

bas.hr’s picture

Same in Croatian...

dp85’s picture

Same in German.

bricel’s picture

Same issue in Hebrew.

podarok’s picture

Status: Needs review » Reviewed & tested by the community

#20 looks good for me

majovdh’s picture

same in dutch subscribing

lismail’s picture

I use version 7.x-1.1 and have same issue in Indonesian. API key is correct and I can manually submit translation to http://localize.drupal.org. It is just stop working. It used to run normally some time ago.

gedvan’s picture

Any update?
I'm having this problem in Portuguese, Brazil too.

podarok’s picture

Priority: Major » Critical

looks like critical issue

hansfn’s picture

I'm having this problem too (in Norwegian Bokmål, long time translator/contributor) and reported it in #1801898: l10n_client - "Not allowed to submit translations in this language." which has been closed as a duplicate of #1759780: Can't do remote submission to LDO server which seems to be a duplicate of this one ...

SebCorbin’s picture

Status: Reviewed & tested by the community » Fixed

#20 committed, issue should disappear on l.d.o in a few days

lismail’s picture

Hi,
Still not working with me. I am using Localization client 7.x-1.1 for Indonesian translation.

Regards,
Lucky

Sutharsan’s picture

@lismail, "... issue should disappear on l.d.o in a few days". Be patient.

SebCorbin’s picture

Just pushed to prod, happy translating everyone!

Sahin’s picture

Tested and worked!
So happy to meet our one and only sweet server again!
Thanks to all contributers.

lismail’s picture

It works as before.
Thank you. You rock!

@Sutharsan, thanks for reminding me :D

Cheers,
Lucky I. Ismail

Gábor Hojtsy’s picture

Thanks SebCorbin for providing the patch and pushing it through! Excellent work :)

PROMES’s picture

Thanks, I can send my translations again!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

s_leu’s picture

Version: 6.x-3.x-dev » 7.x-1.x-dev
Status: Closed (fixed) » Patch (to be ported)

This hasn't been ported to 7.x-1.x yet.

s_leu’s picture

I tried to apply the changes of the 6.x-1.x patch to 7.x-1.x and found that the og_user_roles_grant_roles() and og_get_group_context() don't exist anymore in the drupal 7 version of og. Unfortunately i don't know the og module at all and i can't figure out which functions do have to be used instead of the mentioned ones.

Would be great if someone, that was in involved in the development of the l10n_groups module or someone with more knowledge about the og module could look into that.

Gábor Hojtsy’s picture

Drupal 7 og includes the per group permissions feature, while in Drupal 6 it was in another module called og_user_roles. I did not look into how this is implemented in 7 in OG so don't have direct suggestions. This is related to #2039557: l10n_groups access callback always return FALSE. Same thing there.

SebCorbin’s picture

Status: Patch (to be ported) » Needs review
FileSize
3.3 KB

I need another pair of eyes on this. Basically:

  • og_user_roles_grant_roles doesn't exist anymore in OG7 so I needed to use og_user_access
  • OG context wasn't set because of a bug in l10n_groups_set_context since $langcode parameter was ignored
SebCorbin’s picture

Status: Needs review » Fixed
FileSize
3.5 KB

Reviewed with Gabor and committed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.