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

[WIP] Localized Preferences revisited #11988

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/decisions/0023-localized-preferences.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Localized Preferences

* Status: proposed
* Date: 2021-09-01
* Date: 2024-10-16

## Context and Problem Statement

Expand All @@ -16,8 +16,9 @@

* _Localize Defaults_ (current implementation)
* _Store the Preference only when it was changed by the user_. Otherwise, leave it empty. When a consumer gets such an empty preference, it knows that it needs to read the default and localize it. This won't work if users actually want something to be empty.
* _Store the unlocalized String._ Consumers then check the String they got as a preference against the defaults. If it matches, localize it. Otherwise, use it.
* _Store the unlocalized String._ Consumers then check the String they got as a preference against the defaults. If it matches, localize it. Otherwise, use it.

Check failure on line 19 in docs/decisions/0023-localized-preferences.md

View workflow job for this annotation

GitHub Actions / Markdown

Trailing spaces

docs/decisions/0023-localized-preferences.md:19:160 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md009.md
* _Localize any stored value in the preferences if the string is 'escaped' by `%` as the first character._ Already used in fxml files to indicate translateable strings.

## Decision Outcome

Chosen option: "_Store the unlocalized String._ Consumers then check the String they got as a preference against the defaults. If it matches, localize it. Otherwise, use it.", because Achieves goals without requiring too much refactoring and without (known) downsides.
Chosen option: "_Localize any stored value in the preferences if the string is 'escaped' by `%` as the first character._", because Achieves goals without requiring too much refactoring and reuses a pattern already in use.
Loading