[Koha-bugs] [Bug 7327] New: Translation script doesn't like concatenated javascript strings

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Dec 7 07:16:08 CET 2011


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7327

             Bug #: 7327
           Summary: Translation script doesn't like concatenated
                    javascript strings
    Classification: Unclassified
 Change sponsored?: ---
           Product: Koha
           Version: master
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P5 - low
         Component: I18N/L10N
        AssignedTo: frederic at tamil.fr
        ReportedBy: katrin.fischer at bsz-bw.de
         QAContact: ian.walls at bywatersolutions.com


I noticed that some alerts are (no longer?) translated.

Example: cat-toolbar.inc
is_confirmed= alert(_('There are [ '+ count +' ] item(s) attached to this
record \n You must delete all items before deleting this record.'));

This string doesn't get translated at all now. Also the \n is not good because
it causes problems in Pootle.

The only solution to make this translatable seems to be:

is_confirmed= alert(_("There are [ ") + count + _(" ] item(s) attached to this
record.") + "\n" + _("You must delete all items before deleting this record."

By splitting it up into several part the sentence is very hard to translate.
Also small pieces like "Delete" or "There are" are difficult, because you might
want to use different words for it in your translation.

It would be better if we can make the translation script deal with those
strings and make it put in placeholders. So you would end up with:

is_confirmed= alert(_('There are [ '+ count +' ] item(s) attached to this
record \n You must delete all items before deleting this record.'));

Output in po-file:
There are [ %s ] item(s) attached to this record. ...

I think this is a bug now, because those alerts don't get translated at all.
Splitting them up is one solution, but fixing the translation scripts would be
much better.

-- 
Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the Koha-bugs mailing list