public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager v2] fix #4634: ui: osd: allow to translate the entire string
@ 2023-08-28 15:54 Maximiliano Sandoval
  2023-09-04 16:26 ` Thomas Lamprecht
  0 siblings, 1 reply; 3+ messages in thread
From: Maximiliano Sandoval @ 2023-08-28 15:54 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
xgettext supports extracting comments so I added a comment to make it future
proof. Note though our tooling (proxmox-i18n) strips them. I hope to send a patch fixing
this soon.

Differences from v1:
  - Use format instead of relying on a translator comment.

 www/manager6/ceph/OSD.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/www/manager6/ceph/OSD.js b/www/manager6/ceph/OSD.js
index d2caafa4..242674fb 100644
--- a/www/manager6/ceph/OSD.js
+++ b/www/manager6/ceph/OSD.js
@@ -233,7 +233,8 @@ Ext.define('PVE.CephSetFlags', {
 
     onlineHelp: 'pve_ceph_osds',
     isCreate: true,
-    title: Ext.String.format(gettext('Manage {0}'), 'Global OSD Flags'),
+    // TRANSLATORS: This will read 'Manage Global OSD Flags'.
+    title: Ext.String.format(gettext('Manage Global {0} Flags'), 'OSD'),
     submitText: gettext('Apply'),
 
     items: [
@@ -837,7 +838,7 @@ Ext.define('PVE.node.CephOsdTree', {
 		handler: 'create_osd',
 	    },
 	    {
-		text: Ext.String.format(gettext('Manage {0}'), 'Global Flags'),
+		text: gettext('Manage Global Flags'),
 		handler: 'set_flags',
 	    },
 	    '->',
-- 
2.39.2





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pve-devel] [PATCH manager v2] fix #4634: ui: osd: allow to translate the entire string
  2023-08-28 15:54 [pve-devel] [PATCH manager v2] fix #4634: ui: osd: allow to translate the entire string Maximiliano Sandoval
@ 2023-09-04 16:26 ` Thomas Lamprecht
       [not found]   ` <06fd86b4-0bf0-4dcf-a611-8ed936f4b1a2@proxmox.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Lamprecht @ 2023-09-04 16:26 UTC (permalink / raw)
  To: Proxmox VE development discussion, Maximiliano Sandoval

Am 28/08/2023 um 17:54 schrieb Maximiliano Sandoval:
> Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
> ---
> xgettext supports extracting comments so I added a comment to make it future
> proof. Note though our tooling (proxmox-i18n) strips them. I hope to send a patch fixing
> this soon.
> 
> Differences from v1:
>   - Use format instead of relying on a translator comment.
> 
>  www/manager6/ceph/OSD.js | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/www/manager6/ceph/OSD.js b/www/manager6/ceph/OSD.js
> index d2caafa4..242674fb 100644
> --- a/www/manager6/ceph/OSD.js
> +++ b/www/manager6/ceph/OSD.js
> @@ -233,7 +233,8 @@ Ext.define('PVE.CephSetFlags', {
>  
>      onlineHelp: 'pve_ceph_osds',
>      isCreate: true,
> -    title: Ext.String.format(gettext('Manage {0}'), 'Global OSD Flags'),
> +    // TRANSLATORS: This will read 'Manage Global OSD Flags'.
> +    title: Ext.String.format(gettext('Manage Global {0} Flags'), 'OSD'),

Hmm, not sure how often this will be reused where {0} will be replaced with
something else. I'd rather prefer one of:

- Ext.String.format(gettext('Manage {0}'), gettext('Global OSD Flags')),
  "Manage XYZ" is relatively common, so we might have more reuse potential.

- gettext('Manage Global OSD Flags')
  Fine too, as IMO this is rather specific anyway and unlikely that we have
  many others where a parametrized msgstr is really reducing translation
  effort.

what do you think?




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pve-devel] [PATCH manager v2] fix #4634: ui: osd: allow to translate the entire string
       [not found]   ` <06fd86b4-0bf0-4dcf-a611-8ed936f4b1a2@proxmox.com>
@ 2023-09-05  6:37     ` Thomas Lamprecht
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2023-09-05  6:37 UTC (permalink / raw)
  To: Maximiliano Sandoval; +Cc: PVE development discussion

CC'ing the mailing list again.

Am 05/09/2023 um 08:01 schrieb Maximiliano Sandoval:
> On 9/4/23 18:26, Thomas Lamprecht wrote:
>> Am 28/08/2023 um 17:54 schrieb Maximiliano Sandoval:
>>> -    title: Ext.String.format(gettext('Manage {0}'), 'Global OSD Flags'),
>>> +    // TRANSLATORS: This will read 'Manage Global OSD Flags'.
>>> +    title: Ext.String.format(gettext('Manage Global {0} Flags'), 'OSD'),
>> Hmm, not sure how often this will be reused where {0} will be replaced with
>> something else. I'd rather prefer one of:
>>
>> - Ext.String.format(gettext('Manage {0}'), gettext('Global OSD Flags')),
>>    "Manage XYZ" is relatively common, so we might have more reuse potential.
>>
>> - gettext('Manage Global OSD Flags')
>>    Fine too, as IMO this is rather specific anyway and unlikely that we have
>>    many others where a parametrized msgstr is really reducing translation
>>    effort.
>>
>> what do you think?
>
> I don't think that re-usability should very high in the priority list when it comes
> to translations, the first example for example could potentially make a
> satisfactory translation to certain languages impossible.

Re-usability sure is important for us, one shouldn't have to bend backwards just
for that, like it felt you did with the "'Manage Global {0} Flags'), 'OSD'" one,
but certainly good to use a harmonised set of terminology.

FWIW: avoiding to much churn is definitively also high on the priority list, as
that doesn't makes life of translators easier.

> 
> I don't see any problem with the second suggested approach, which as it happens
> is the contents of v1 of the patch.
> 

Yeah, I'd rather like the full thing here, as said it's specialized enough to not
bother with re-usability here until we'd actual require it (maybe if there are
global monitor or MDS flags), as future-proofing for translations is especially
hard. That would then also allow us to drop the comment due it becoming superfluous.

ps. Please don't top post, that's making this harder and rather irritating to read
and follow.




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-09-05  6:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-28 15:54 [pve-devel] [PATCH manager v2] fix #4634: ui: osd: allow to translate the entire string Maximiliano Sandoval
2023-09-04 16:26 ` Thomas Lamprecht
     [not found]   ` <06fd86b4-0bf0-4dcf-a611-8ed936f4b1a2@proxmox.com>
2023-09-05  6:37     ` Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal