Skip to content

fix: add missing localization files (app_nb.arb, app_zh.arb) to resol…#1611

Open
DELTA-45-G wants to merge 3 commits intofossasia:developmentfrom
DELTA-45-G:fix/l10n-fallback-error
Open

fix: add missing localization files (app_nb.arb, app_zh.arb) to resol…#1611
DELTA-45-G wants to merge 3 commits intofossasia:developmentfrom
DELTA-45-G:fix/l10n-fallback-error

Conversation

@DELTA-45-G
Copy link
Copy Markdown

@DELTA-45-G DELTA-45-G commented Mar 11, 2026

fix: add missing localization files to resolve build error

Fixes #1588

Changes

  • Created lib/l10n/app_nb.arb as a fallback for Norwegian.
  • Created lib/l10n/app_zh.arb as a fallback for Chinese.
  • Copied English strings into these files to satisfy the "Arb file for a fallback does not exist" requirement in newer Flutter versions.

Screenshots / Recordings

N/A (Build/Backend fix)

Checklist:

  • No hard coding: I have used resources from constants.dart without hard coding any value.
  • No end of file edits: No modifications done at end of resource files.
  • Code reformatting: I have reformatted code and fixed indentation in every file included in this pull request.
  • Code analyzation: My code passes analyzations run in flutter analyze and tests run in flutter test.

Summary by Sourcery

Bug Fixes:

  • Resolve Flutter build errors by providing fallback ARB files for Norwegian (nb) and Chinese (zh) localizations.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Mar 11, 2026

🧙 Sourcery has finished reviewing your pull request!


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • For the new app_nb.arb and app_zh.arb files, double-check that the locale codes (nb, zh) match how the app and Flutter’s localization setup reference Norwegian and Chinese (e.g., no, nb_NO, zh_Hans, zh_Hant) to avoid subtle fallback mismatches.
  • Ensure the new ARB files mirror the structure and metadata (placeholders, descriptions, @-entries) of your primary app_en.arb so that localized messages using interpolations or plurals don’t break for these fallback locales.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- For the new `app_nb.arb` and `app_zh.arb` files, double-check that the locale codes (`nb`, `zh`) match how the app and Flutter’s localization setup reference Norwegian and Chinese (e.g., `no`, `nb_NO`, `zh_Hans`, `zh_Hant`) to avoid subtle fallback mismatches.
- Ensure the new ARB files mirror the structure and metadata (placeholders, descriptions, @-entries) of your primary `app_en.arb` so that localized messages using interpolations or plurals don’t break for these fallback locales.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@DELTA-45-G
Copy link
Copy Markdown
Author

Thanks for the feedback, @sourcery-ai

The filenames 'app_nb.arb' and 'app_zh.arb' were chosen because the Flutter build tool was throwing an error expecting these specific locale codes.

Both files are direct copies of 'app_en.arb', so the structure, placeholders, and metadata remain identical to ensure consistency and prevent issues with interpolations or pluralized messages.

@mariobehling mariobehling requested a review from Copilot April 13, 2026 00:43
@mariobehling
Copy link
Copy Markdown
Member

Thanks for the contribution!

A process note.

We have automatic Copilot PR reviews enabled on this repository. These reviews are only triggered if the contributor has GitHub Copilot enabled and an active license on their own account.

Please enable Copilot in your GitHub settings if you have access. In many regions, free licenses are available through educational institutions or developer programs. Enabling Copilot helps us speed up the auto review process and reduces manual review overhead for the core team.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds missing base-locale ARB fallback files required by newer Flutter gen_l10n behavior, resolving build errors when region/script-specific locale files exist without their base counterparts (Fixes #1588).

Changes:

  • Added lib/l10n/app_nb.arb as the required base fallback for nb (to pair with app_nb_NO.arb).
  • Added lib/l10n/app_zh.arb as the required base fallback for zh (to pair with app_zh_Hans.arb / app_zh_Hant.arb).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
lib/l10n/app_nb.arb Adds base-locale fallback file required by gen_l10n for Norwegian.
lib/l10n/app_zh.arb Adds base-locale fallback file required by gen_l10n for Chinese.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/l10n/app_zh.arb Outdated
Comment thread lib/l10n/app_nb.arb Outdated
@github-actions
Copy link
Copy Markdown
Contributor

Build Status

Build successful. APKs to test: https://github.com/fossasia/badgemagic-app/actions/runs/24320500510/artifacts/6396761531.

Screenshots

Android Screenshots
iPhone Screenshots
iPad Screenshots

Copy link
Copy Markdown
Member

@mariobehling mariobehling left a comment

Choose a reason for hiding this comment

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

Please address AI reviews or add comments if not relevant.

@DELTA-45-G
Copy link
Copy Markdown
Author

Hi @mariobehling , I have addressed the AI reviews by refactoring app_nb.arb and app_zh.arb to be empty {}. This resolves the build errors in #1588 without adding unnecessary technical debt. Ready for another look

@DELTA-45-G DELTA-45-G requested a review from mariobehling April 15, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing base locale fallback files for nb and zh in l10n directory

3 participants