Tíquete #43989

Translated counter names

: 2022-02-27 01:56 Última Atualização: 2022-03-03 18:39

Relator:
Tipo:
Estado:
Fechado
Componente:
Marcos:
Prioridade:
5 - Medium
Gravidade:
5 - Medium
Resolução:
Fixed
Arquivo:
2

Details

Introduce counter_name_translation() and counter_by_translated_name() functions in common/counter.[ch].

Ticket History (3/9 Histories)

2022-02-27 01:56 Updated by: alienvalkyrie
  • New Ticket "Translated counter names" created
2022-03-01 00:54 Updated by: lachu
Comentário

I send first version of patch implementing localized/translatable counters.

2022-03-01 03:49 Updated by: alienvalkyrie
Comentário
  • To initialize a name_translation struct, use the NAME_INIT macro rather than an explicit initializer or compound literal – the internal shape of the structure is not public.
  • In counters_init(), name_set should probably not happen inside the loop – that code will likely change anyway before it becomes relevant, but I'd rather avoid the possibility of accidentally giving multiple different counters the same rule_name.
  • counter_by_rule_name() should use counter_rule_name(), rather than accessing the name struct directly
  • In counters.h, put a /* common */ comment before the include of name_translation.h (also see the "Including Headers" section in doc/CodingStyle, or how includes are structured in other files).
2022-03-01 19:16 Updated by: alienvalkyrie
Comentário

Also, I just remembered: In order to be translatable, the name should be tagged with the N_() macro – that marks the string, but doesn't translate it (since we don't want to translate the rule name). Also, since the string "Owned" is used in other places, it should be qualified with something like ?counter:, so N_("?counter:Owned").

2022-03-02 01:02 Updated by: lachu
Comentário

Reply To alienvalkyrie

Also, I just remembered: In order to be translatable, the name should be tagged with the N_() macro – that marks the string, but doesn't translate it (since we don't want to translate the rule name). Also, since the string "Owned" is used in other places, it should be qualified with something like ?counter:, so N_("?counter:Owned").

Ok.

2022-03-02 01:49 Updated by: alienvalkyrie
  • Dono Update from (Nenhum) to alienvalkyrie
  • Resolução Update from Nenhum to Accepted
Comentário

Looks good. There are some missing/misplaced blank lines (mostly around counter_by_translated_name()), but I can clean those up (and mention this ticket in the commit message) when merging the patch.

2022-03-03 18:39 Updated by: alienvalkyrie
  • Estado Update from Aberto to Fechado
  • Resolução Update from Accepted to Fixed

Attachment File List

Editar

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login