Floats do not have a "dot" in German. They have a comma.

http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/xmlsitemap/...

Comments

hass’s picture

Title: Removed more translatable strings that were simply numbers. » Rollback: Removed more translatable strings that were simply numbers.
avpaderno’s picture

Status: Active » Postponed (maintainer needs more info)

Do Drupal core modules show floating numbers with a comma, when Drupal is localized in German, or Italian?

dave reid’s picture

I can't find any example in the translations.

avpaderno’s picture

Then, what do third-party modules do?

avpaderno’s picture

Title: Rollback: Removed more translatable strings that were simply numbers. » Floating number needs to be translated
Status: Postponed (maintainer needs more info) » Active
avpaderno’s picture

Title: Floating number needs to be translated » Constant floating numbers shown in the user interface must the translatable
Category: bug » task
Status: Active » Fixed

This has been fixed in CVS.

hass’s picture

For future we really need a format_number() function... core is missing this, but I don't know why. So the t() is a workaround for now.

dave reid’s picture

Brainstorming here...what if... we used the following code for the priority options:

  foreach (range(0, 1, 0.1) as $option) {
    $option = number_format($option, 1);
    $options[$option] = t($option);
  }

And then created an xmlsitemap.translations.inc file that is *only* used so that the strings will be picked up by the translation template extracter:

// $Id$

t('0.0');
t('0.1');
t('0.2');
t('0.3');
t('0.4');
t('0.5');
t('0.6');
t('0.7');
t('0.8');
t('0.9');
t('1.0');

Would this work? I'm going to try it out.

dave reid’s picture

Actually, it worked! :)

hass’s picture

Yes, this will also work... It's the way a few things have been implemented in the Date and Event module, too. For e.g. for the *many* time zones...

EDIT: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/date/date_t... and jump to function date_timezone_translate() {

hass’s picture

dave reid’s picture

I've implemented the workaround method used by date and event in the 6.x-2.x branch. See http://drupal.org/cvs?commit=215524.

avpaderno’s picture

Brainstorming here...what if... we used the following code for the priority options:

  foreach (range(0, 1, 0.1) as $option) {
    $option = number_format($option, 1);
    $options[$option] = t($option);
  }

The only problem will be if you use potx.module to create the translation template file, which would not include those strings, and report you that you are using a variable in a call to t().

Status: Fixed » Closed (fixed)

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

avpaderno’s picture

Title: Constant floating numbers shown in the user interface must the translatable » Constant floating numbers shown in the user interface must be translatable