[2.x] fix: nest the gambit translations under the extension namespace - #167
Merged
Conversation
The `lib` key sat at the root of the locale file rather than under `fof-gamification`, so the gambit asked for `fof-gamification.lib.gambits.trending.key` and the translator only had `lib.gambits.trending.key` to offer it. Nothing matched, and because the gambit looks the key up in raw mode the untranslated key itself was returned — so the search modal listed the literal `fof-gamification.lib.gambits.t...` among its `is:` options instead of `trending`. The block has been misplaced since the 2.0 update, so the gambit has never shown a usable label on this branch; renaming `hot` to `trending` carried the indentation along with it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
is:line in the search modal listed a raw translation key instead oftrending:libsat at the root ofresources/locale/en.ymlrather than underfof-gamification, giving the file two top-level namespaces.TrendingGambitasks forfof-gamification.lib.gambits.trending.key, the translator only hadlib.gambits.trending.key, and since the gambit resolves its key in raw mode the miss returned the key itself for display.The block has been at the wrong level since #131, so the gambit has never shown a usable label on 2.x — #165 renamed
hottotrendingand carried the indentation with it.Verified by parsing the file with the same YAML component Flarum uses: one top-level key afterwards, and
fof-gamification.lib.gambits.trending.keyresolving totrending.Not fixed here, and not caused by this: the row still clips rather than wraps when the joined
is:values outgrow the modal. That is core styling (.GambitsAutocomplete-gambitis a flex row with nomin-width: 0and no wrapping on the value), and it gets worse as more extensions register boolean gambits. Being handled separately in core.