Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sweep through UI strings to internationalize #1148

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

PIG208
Copy link
Member

@PIG208 PIG208 commented Dec 12, 2024

@gnprice
Copy link
Member

gnprice commented Dec 17, 2024

Thanks!

This is a lot fewer new strings than I'd expected it to be. I guess we've been pretty good about i18n in new code for the past year or so.

I did part of a sweep through git grep '"' lib and git grep "'" lib and found a few more (amongst lots of results in comments and in non-user-facing or otherwise invariant strings):

lib/widgets/content.dart
1576:      TextSpan(text: "(unimplemented:", style: errorStyle),
1578:      TextSpan(text: ")", style: errorStyle),
1582:      TextSpan(text: "(unimplemented: text «", style: errorStyle),
1584:      TextSpan(text: "»)", style: errorStyle),
1588:      text: "(unimplemented: DOM node type ${htmlNode.nodeType})",

lib/widgets/lightbox.dart
391:        semanticsLabel: "Current position"),
421:        semanticsLabel: "Video duration"),

lib/widgets/message_list.dart
429:          return Text("DMs with ${names.join(", ")}"); // TODO show avatars
648:            child: Text("No earlier messages."))); // TODO use an icon
699:        tooltip: "Scroll to bottom",
1147:        .join(", "));

lib/licenses.dart
26:      return '$licenseFileText\n\nAUTHORS file follows:\n\n$authorsFileText';

lib/model/compose.dart
148:  return '${mention(sender!, silent: true)} ${inlineLink('said', url)}: ' // TODO(i18n) ?
149:    '*(loading message ${message.id})*\n'; // TODO(i18n) ?
172:    return '${mention(sender!, silent: true)} ${inlineLink('said', url)}:\n' // TODO(i18n) ?

(Stopping there to switch to another task — the remaining code for that sweep is in the "'" grep, starting from lib/model/content.dart.)

PIG208 added 10 commits January 8, 2025 20:57
Renamed the "composeBoxUnknownChannelName" string to generalize it.
This also added a string for notification message that may contain
'(unknown channel)'.

Signed-off-by: Zixuan James Li <[email protected]>
This descriptions were taken from [VideoPlayerValue].

Signed-off-by: Zixuan James Li <[email protected]>
Ideally we should implement zulip#1080 for DMs title, but we might switch to
showing avatars as the TODO indicated before we work on lists' proper
translation.

Signed-off-by: Zixuan James Li <[email protected]>
This renames notifSelfUser to make it more general.

Signed-off-by: Zixuan James Li <[email protected]>
@PIG208
Copy link
Member Author

PIG208 commented Jan 8, 2025

Marking this for review as I think it would be a good checkpoint. I did a sweep with git grep "'" lib | grep -v // | grep -v 'import' and git grep '"' lib | grep -v // | grep -v 'import' (as well as git grep "'" lib | grep // and git grep '"' lib | grep //), and these seem to be the ones left:

lib/widgets/content.dart
1576:      TextSpan(text: "(unimplemented:", style: errorStyle),
1578:      TextSpan(text: ")", style: errorStyle),
1582:      TextSpan(text: "(unimplemented: text «", style: errorStyle),
1584:      TextSpan(text: "»)", style: errorStyle),
1588:      text: "(unimplemented: DOM node type ${htmlNode.nodeType})",

lib/licenses.dart
26:      return '$licenseFileText\n\nAUTHORS file follows:\n\n$authorsFileText';

lib/model/compose.dart
148:  return '${mention(sender!, silent: true)} ${inlineLink('said', url)}: ' // TODO(i18n) ?
149:    '*(loading message ${message.id})*\n'; // TODO(i18n) ?
172:    return '${mention(sender!, silent: true)} ${inlineLink('said', url)}:\n' // TODO(i18n) ?

As well as the .join onese (#1080) that are out-of-scope for #277.

The licenses one can probably be translated with GlobalLocalization; the compose.dart ones involve links; and the unimplemented text uses different styles. Leaving those as follow-ups to the PR.

For commits that are local to a file or a class, I use the more specific tag, otherwise i18n is used. None of them is nfc because there would be an appearance change once the new strings are translated.

@PIG208 PIG208 marked this pull request as ready for review January 8, 2025 16:27
@PIG208 PIG208 requested a review from chrisbobbe January 8, 2025 16:29
@PIG208 PIG208 added the maintainer review PR ready for review by Zulip maintainers label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer review PR ready for review by Zulip maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants