Modify

Opened 4 years ago

Closed 4 years ago

#10994 closed defect (fixed)

[PATCH] Better than separated messages for translations

Reported by: Jun Omae Owned by: Dirk Stöcker
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 Jun Omae 4 years ago.

Download all attachments as: .zip

Change History (4)

Changed 4 years ago by Jun Omae

comment:1 Changed 4 years ago by Jun Omae

Trac Release: 0.121.0

comment:2 Changed 4 years ago by Jun Omae

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 4 years ago by Dirk Stöcker

Resolution: fixed
Status: newclosed

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Dirk Stöcker.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.