Skip to content

change how durations are formatted to be i18n friendly#1968

Merged
hahn-kev merged 2 commits into
developfrom
fix-duration-format-i18n
Sep 4, 2025
Merged

change how durations are formatted to be i18n friendly#1968
hahn-kev merged 2 commits into
developfrom
fix-duration-format-i18n

Conversation

@hahn-kev

@hahn-kev hahn-kev commented Sep 3, 2025

Copy link
Copy Markdown
Collaborator

Danny pointed out some of our duration formats can't be correctly localized due to word order differences.

This fixes the 2 that he found and one that I came across while making the changes, but there could be others.

@coderabbitai

coderabbitai Bot commented Sep 3, 2025

Copy link
Copy Markdown

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

Localization updates across English, Spanish, French, Indonesian, and Korean PO files: introduce "# ago" and "# before", remove "ago" and "before", add "Synced {0} ago" (context shifts to ActivityView), adjust "Synced" contexts, and add "Synchronize" (EN) and "a word" (ID).

Changes

Cohort / File(s) Summary
Relative-time key migration
frontend/viewer/src/locales/en.po, .../es.po, .../fr.po, .../id.po, .../ko.po
Added "# ago" and "# before" (HistoryView, ActivityView); removed "ago" and "before" from those contexts.
Synced phrasing updates
frontend/viewer/src/locales/en.po, .../fr.po, .../id.po, .../ko.po
Added "Synced {0} ago" (ActivityView); adjusted/remodeled "Synced" contexts (e.g., removed from ActivityView or ProjectSidebar per locale).
English: new action string
frontend/viewer/src/locales/en.po
Added "Synchronize" (SyncDialog, ProjectSidebar); removed standalone "Synced" from ProjectSidebar; kept "Synced with {0}".
Spanish: placeholders
frontend/viewer/src/locales/es.po
New keys present with empty translations; "Synced" in ProjectSidebar unchanged; "Synced {0} ago" added.
French: context refinement
frontend/viewer/src/locales/fr.po
"Synced" now only under ProjectSidebar; "Synced {0} ago" added (empty translation).
Indonesian: extra string
frontend/viewer/src/locales/id.po
Added "a word" (BrowseView); moved to "Synced {0} ago" in ActivityView; removed old "Synced" in entries/history contexts.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Format dates with lingui/core #1730 — Also modifies date/time formatting and localization in related UI (e.g., SyncDialog/ActivityView), aligning with the shift to new time-ago translation keys.

Suggested labels

💻 FW Lite

Suggested reviewers

  • myieye

Poem

I nibble strings and hop through PO,
Swapping “ago” for “# ago” in tow.
“Synced {0} ago” taps time just right,
From sidebars to views, a tidy byte.
Tap-tap, translate—then off I go! 🥕✨

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-duration-format-i18n

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions Bot added the 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related label Sep 3, 2025
@github-actions

github-actions Bot commented Sep 3, 2025

Copy link
Copy Markdown
Contributor

UI unit Tests

  1 files  ±0   41 suites  ±0   16s ⏱️ -2s
 90 tests ±0   90 ✅ ±0  0 💤 ±0  0 ❌ ±0 
124 runs  ±0  124 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 9db246f. ± Comparison against base commit 8d5aa04.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 3, 2025

Copy link
Copy Markdown
Contributor

C# Unit Tests

130 tests  ±0   130 ✅ ±0   18s ⏱️ -1s
 20 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 9db246f. ± Comparison against base commit 8d5aa04.

♻️ This comment has been updated with latest results.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (12)
frontend/viewer/src/locales/es.po (3)

65-69: Translate '# ago' to match Spanish word order ('hace #').

Empty msgstr will fall back to English. Use preposed 'hace' to allow correct reordering.

-msgstr ""
+msgstr "hace #"

70-74: Translate '# before' for Spanish.

Use '# antes' (e.g., '3 días antes'). Keeps '#' placeholder position intact.

-msgstr ""
+msgstr "# antes"

1015-1018: Provide Spanish for 'Synced {0} ago'.

Natural phrasing places 'hace' before the duration.

-msgstr ""
+msgstr "Sincronizado hace {0}"
frontend/viewer/src/locales/fr.po (3)

65-69: Fill FR translation for '# ago'.

Standard French is 'il y a #'.

-msgstr ""
+msgstr "il y a #"

70-74: Fill FR translation for '# before'.

Use '# avant' (e.g., '3 jours avant').

-msgstr ""
+msgstr "# avant"

1015-1018: Translate 'Synced {0} ago' to French.

Matches common UI phrasing.

-msgstr ""
+msgstr "Synchronisé il y a {0}"
frontend/viewer/src/locales/id.po (3)

65-69: Add ID translation for '# ago'.

Use '# yang lalu' (e.g., '5 menit yang lalu').

-msgstr ""
+msgstr "# yang lalu"

70-74: Add ID translation for '# before'.

Use '# sebelumnya' (e.g., '3 hari sebelumnya').

-msgstr ""
+msgstr "# sebelumnya"

1015-1018: Translate 'Synced {0} ago' to Indonesian.

-msgstr ""
+msgstr "Disinkronkan {0} yang lalu"
frontend/viewer/src/locales/ko.po (3)

65-69: Provide KO translation for '# ago'.

Korean uses a postposition; include a space: '# 전' (e.g., '5분 전').

-msgstr ""
+msgstr "# 전"

70-74: Provide KO translation for '# before'.

Same rendering as 'ago' in Korean.

-msgstr ""
+msgstr "# 전"

1015-1018: Translate 'Synced {0} ago' to Korean.

-msgstr ""
+msgstr "{0} 전에 동기화됨"
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8d5aa04 and 1e14d9a.

📒 Files selected for processing (5)
  • frontend/viewer/src/locales/en.po (2 hunks)
  • frontend/viewer/src/locales/es.po (2 hunks)
  • frontend/viewer/src/locales/fr.po (2 hunks)
  • frontend/viewer/src/locales/id.po (2 hunks)
  • frontend/viewer/src/locales/ko.po (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Build API / publish-api
  • GitHub Check: Build UI / publish-ui
  • GitHub Check: Build FW Lite and run tests
  • GitHub Check: frontend-component-unit-tests
  • GitHub Check: check-and-lint
🔇 Additional comments (1)
frontend/viewer/src/locales/en.po (1)

1010-1013: LGTM: 'Synced {0} ago' is clear and consistent with the new pattern.

Comment thread frontend/viewer/src/locales/en.po
@argos-ci

argos-ci Bot commented Sep 3, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Sep 3, 2025, 8:18 AM

@hahn-kev hahn-kev merged commit d836877 into develop Sep 4, 2025
23 checks passed
@hahn-kev hahn-kev deleted the fix-duration-format-i18n branch September 4, 2025 03:04
@coderabbitai coderabbitai Bot mentioned this pull request Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants