Skip to content

fix: show no borrowed flag for a language that has none - #456

Merged
TRC-Loop merged 1 commit into
mainfrom
fix/no-borrowed-flag-for-arabic
Sep 24, 2026
Merged

TRC-Loop merged 1 commit into
mainfrom
fix/no-borrowed-flag-for-arabic

Conversation

@TRC-Loop

Copy link
Copy Markdown
Member

Fixes #440.

The Arabic tile showed Portugal's flag. Not a wrong entry in the table: flagFor had no entry for Arabic at all, and fell through to the reader's own region, which on a machine listing Portuguese is Portugal. Any language without an entry would have done the same, and Arabic is the only one, so that fallback existed solely to serve it and served it with a flag picked off the user's machine.

What it does now

The fallback is gone. A language either has a flag we can name or it has none, and Arabic is given none.

There is no neutral country to choose. Arabic is official across some twenty countries, and picking one would be a statement rather than a fact, whichever it was. A flag chosen at random from the reader's locale list is worse again: it is not even a claim, just noise.

The picker shows a globe where a flag would be, so the tiles stay aligned and the absence reads as chosen rather than as a missing image. Custom user translations already had no flag and now show the same mark, which matches what the module has always said about them belonging to no country.

One thing kept

A reader whose own system is set to ar-EG or ar-MA still sees that flag. That region is their own setting, not a country picked for them, and it is the same rule that gives an en-US machine the US flag rather than the union flag. Only borrowing a region from a different language is gone.

I had this wrong in the first draft of the test and the test caught it, which is why it is now spelled out in one.

Tests

Five, covering: Arabic gets nothing from an unrelated region, Arabic keeps a region the reader set themselves, the rule is general rather than a special case for one language, and every language that does have a flag still resolves to it. That last one matters because this change narrows what is shown and it would be easy to narrow too far.

Signed-off-by: Arne K. (TRC-Loop) <me@arne.sh>
@TRC-Loop
TRC-Loop merged commit eaca82d into main Sep 24, 2026
9 checks passed
@TRC-Loop
TRC-Loop deleted the fix/no-borrowed-flag-for-arabic branch September 24, 2026 16:36
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.

Language picker shows the Portuguese flag next to Arabic (丕賱毓乇亘賷丞)

1 participant