#789 1.3.29 - HTML UI template, translation issues

1.3
closed-fixed
5
2013-03-23
2013-02-14
No

After the translation fix ([_1]->%1) I still found some untranslated messages, for example search customers/vendors/employee. (Title: Vendor Search)
I found this code in the search.html:ú
<?lsmb IF account_class == 1 -?>
<?lsmb entity_type = 'Vendor' -?>
<?lsmb ELSIF account_class == 2 -?>
<?lsmb entity_type = 'Customer' -?>
<?lsmb ELSIF account_class == 3 -?>
<?lsmb entity_type = 'Employee' -?>
<?lsmb ELSE -?>
<?lsmb entity_type = 'Unsupported' -?>
<?lsmb END -?>
<?lsmb title = text("$entity_type Search") # " -?>

Of course, it will not able to translate this dynamic text.
I made a quick workaround, like this:
<?lsmb IF account_class == 1 -?>
<?lsmb entity_type = text('Vendor') -?>
<?lsmb title = text('Search Vendor') -?>
<?lsmb ELSIF account_class == 2 -?>
<?lsmb entity_type = text('Customer') -?>
<?lsmb title = text('Search Customer') -?>
<?lsmb ELSIF account_class == 3 -?>
<?lsmb entity_type = text('Employee') -?>
<?lsmb title = text('Search Employee') -?>
<?lsmb ELSE -?>
<?lsmb entity_type = 'Unsupported' -?>
<?lsmb END -?>
<form method="get" action="<?lsmb script ?>">
<?lsmb INCLUDE input element_data = {
type = "hidden"
name = "account_class"
value = account_class
} -?>

Because I do not know, how to concatenate strings inside <?lsmb ?> tags, I was not able to make it shorter.
Teoretically it can work like this (if assume concatenating working like this):
<?lsmb IF account_class == 1 -?>
<?lsmb entity_type = 'Vendor' -?>
<?lsmb ELSIF account_class == 2 -?>
<?lsmb entity_type = 'Customer' -?>
<?lsmb ELSIF account_class == 3 -?>
<?lsmb entity_type = 'Employee' -?>
<?lsmb ELSE -?>
<?lsmb entity_type = 'Unsupported' -?>
<?lsmb END -?>
<?lsmb title = $entity_type +" "+text("Search") # " -?> CHECK THIS LINE
<form method="get" action="<?lsmb script ?>">
<?lsmb INCLUDE input element_data = {
type = "hidden"
name = "account_class"
value = account_class
} -?>

Discussion

  • Pongracz Istvan

    Pongracz Istvan - 2013-02-14

    Sorry, 1.3.29

     
  • Pongracz Istvan

    Pongracz Istvan - 2013-02-14
    • summary: 1.3.28 - HTML UI template, translation issues --> 1.3.29 - HTML UI template, translation issues
     
  • Chris Travers

    Chris Travers - 2013-02-15

    The best approach would be to translate the whole string in each of the if blocks and then just incorporate it as a variable later.

     
  • Chris Travers

    Chris Travers - 2013-03-23
    • assigned_to: nobody --> einhverfr
     
  • Chris Travers

    Chris Travers - 2013-03-23
    • status: open --> closed-fixed
     
  • Chris Travers

    Chris Travers - 2013-03-23

    5693

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks