Modify

#10994 closed defect (fixed)

[PATCH] Better than separated messages for translations

Reported by: jun66j5 Owned by: stoecker
Priority: normal Component: TracIniAdminPanelPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.0

Description

The following code in templates/editor-data.js separates messages for translation.

var text_modified = '${_("Modified: ")}';
var text_defaults = '${_(" | Defaults: ")}';
var text_optionscount = '${_(" | Options count: ")}';

It would be better to be the following instead.

var info_format = '${javascript_quote(_("Modified: %(mod)d | Defaults: %(def)d | Options count: %(opt)d"))}';

In addition, should use javascript_quote.

-  s['${option_name}'] = '${option.stored_value.replace('\\\\', '\\\\\\\\').replace("'", "\\\\'")}';
+  s['${javascript_quote(option_name)}'] = '${javascript_quote(option.stored_value)}';

Full patch: traciniadminpanel-better-i18n-r12844.diff

Attachments (1)

traciniadminpanel-better-i18n-r12844.diff (2.7 KB) - added by jun66j5 17 months ago.

Download all attachments as: .zip

Change History (4)

Changed 17 months ago by jun66j5

comment:1 Changed 17 months ago by jun66j5

  • Trac Release changed from 0.12 to 1.0

comment:2 Changed 17 months ago by jun66j5

The help in the following should be not separated to three messages.

  • inieditorpanel/templates/admin_tracini.html

     
    1919  <body> 
    2020    <h2>Edit Trac Settings (trac.ini)</h2> 
    2121 
    22     <p class="help"> 
     22    <p class="help" i18n:msg=""> 
    2323      Allows you to edit the trac.ini file.<br/><i>Note:</i> To "delete" an option from the trac.ini file, just set it to its default value. 
    2424    </p> 
    2525 

comment:3 Changed 17 months ago by stoecker

  • Resolution set to fixed
  • Status changed from new to closed

(In [12848]) fix #10994 - i18n optimizations

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.