Error messages are not translated

CommentFileSizeAuthor
#14 i1506188-14.png21.56 KBattiks
#9 i1506188.png23.46 KBattiks

Comments

attiks’s picture

Status: Active » Postponed (maintainer needs more info)

Can you provide a little bit more information? Did you translate the error message using the translate interface?

michiellucas’s picture

yes,

translations are filled in, when i disable this module the errors are translated.

Language settings:

English disabled
Dutch enabled and default
French enabled

attiks’s picture

Source language Dutch or English?

michiellucas’s picture

English

attiks’s picture

Status: Postponed (maintainer needs more info) » Active

Any chance I can get access to the site?

This module just calls Drupal.t() from inside javascript, so it should work the same as t() on the server side. But i never tried it with changing the default language.

jelle_s’s picture

Also, we put all our error messages through a theme function that looks like this:

function theme_clientside_error($variables) {
  return t($variables['message'], $variables['placeholders']);
}

So they really should be translated/translatable...

michiellucas’s picture

michiellucas’s picture

This are forms embedded in panels, maybe the problem is there?

attiks’s picture

StatusFileSize
new23.46 KB

Parts are translated, see screenshot. So triple check the translation interface

i1506188.png

attiks’s picture

Default string for required is "'!title field is required.'", but is seems you're using something like "The field !title field is required." so search for all string containing "required", I assume you didn't translate at least one.

michiellucas’s picture

Priority: Major » Minor
Status: Active » Closed (fixed)
michiellucas’s picture

Priority: Minor » Major
Status: Closed (fixed) » Active

I found a part of the translation

Originele tekst !title field is required.

Now he gives this error message: The field Mijn vraag is verplicht. So he translates a part of the message.
The field is not found in translate interface.

When i disable clientside validation the messages are perfect translated.

Strange

michiellucas’s picture

This is a webform. Something goes wrong, he thinks the label of the field is: The field Title

Strange thing is that without the clientside validation he gives to correct message

attiks’s picture

Priority: Major » Normal
StatusFileSize
new21.56 KB

Did you define a prefix at admin/config/validation/clientside_validation - Field name prefix?

I created a webform at http://atix.be/ZkY and it seems ok to me, I translated the following strings:

i1506188-14.png

michiellucas’s picture

Status: Active » Closed (works as designed)

Never trust a interim, thx for the quick answers

attiks’s picture

@Michiel I assume it was the prefix?

Anonymous’s picture

Version: 7.x-1.30 » 7.x-1.34
Status: Closed (works as designed) » Active

Sorry to warm this old issue up, but I think I found the root of this problem: It seems like "!title field is required." and/or "!name field is required." doesn't show up anymore on localize.drupal.org. "!name field is required." was there until 7.x-1.16. Since then, it went missing on all later versions of this module. If you look here, you can see that the string "!title field is required." doesn't show up for translation in the latest version of this module. Neither does "!name field is required.".

I ran a "cat * | grep 'field is required.'" in the modules directory and I didn't find any references to a t() using this string. From what I know, this is how localize.drupal.org gets its strings from contrib. Anything else cannot be translated. I found "$message = '!title field is required.';" in the sourcecode, which seems to be a hardcoded string without using t().

Could you please have a look at this again? Thank you very much! :-)

attiks’s picture

Version: 7.x-1.34 » 7.x-1.x-dev
Assigned: Unassigned » jelle_s
attiks’s picture

Assigned: jelle_s » attiks

#17 you're right "!title field is required." isn't at l.d.o., but "!name field is required." is.

The reason is that we added a theme wrapper function around the error messages (#6) so people can easily alter the message before it is translated.

I'll see how we can upload the regular messages to l.d.o.

attiks’s picture

Assigned: attiks » jelle_s

We need to add all strings to clientside_validation.api.php, so they get detected by l.d.o.

jelle_s’s picture

Fixed in latest dev. Leaving this open for now so we can see if l.d.o updates correctly.

Anonymous’s picture

Thanks for looking into this.

What I meant was that "!name field is required." isn't missing, but "disappeared". The string isn't being picked up by l.d.o in code after 7.x-1.16 of this module. The string itself is being used by a large number of other modules, therefore not missing.

"Show related projects" says:

Clientside Validation: 6.x-1.0 (5), 6.x-1.1 (5), 6.x-1.2 (2), 6.x-1.3 (2), 7.x-1.0 (2), 6.x-1.4 (2), 6.x-1.5 (2), 6.x-1.6 (2), 6.x-1.7 (2), 6.x-1.8 (2), 7.x-1.1 (4), 6.x-1.10 (4), 6.x-1.11 (2), 6.x-1.12 (2), 7.x-1.11 (2), 6.x-1.13 (4), 6.x-1.14 (4), 6.x-1.15 (2), <strong>7.x-1.16 (4)</strong>, 6.x-1.18 (4), 6.x-1.19 (4)

attiks’s picture

#22 that should be fixed whenever l.d.o. scans again, I assume they should be back somewhere tomorrow.

attiks’s picture

Just talked to Gabor on IRC, we need to create a new release before the strings are detected.

attiks’s picture

It appears that clientside_validation.api.php is not picked up, @Jelle_S is going to fix it

jelle_s’s picture

I moved the translations to clientside_validation.strings.php.

attiks’s picture

Version: 7.x-1.x-dev » 7.x-1.36
Assigned: jelle_s » Unassigned
Status: Active » Fixed

Fixed in 7.x-1.36

Anonymous’s picture

Perfect, thank you!

Status: Fixed » Closed (fixed)

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