-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Fixed #14976, #14975, #14973 - Translation strings aren't always working #14981
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we maybe want to use the normal Laravel
FALLBACK_APP_LOCALE
env variable here? It seems like a potential footgun to invent our own override here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I don't think so. The
FALLBACK_APP_LOCALE
is the fallback locale for Snipe-IT - and so it's going to be something likeen-US
orpt-PT
. Whereas, in this code, we are dropping back to 'legacy' locales -en
orpt
or whatever. I could maybe see adding yet another (UGH).env
var to specify what 'legacy locale' you want to fall-back to when your main language isn't there - and since Snipe-IT is translated into many more languages than Spatie backup is, that's going to happen for sure.I feel like 'hiding' the legacy locale situation from the users seems best, and picking US English as a fallback, when your language isn't there, is a pretty reasonable choice.
Some very weird situations could be created if we allow users to change this - Having a 'locale' of
en-US
and a 'legacy fallback locale' ofpt
for example would be extremely weird. Or if a user naively picked for their "legacy fallback locale"af
- for Afrikaans - and it doesn't exist at all (in Spatie) - then they'd just get raw translation strings back. So I'd rather avoid those kinds of scenarios and stick to something that makes the most sense, and we know is going to work. It's also possible that Spatie could change their mind and start using the ISO-compliant localization names too in the future - and now we'd have this silly exposed environment variable that doesn't make sense anymore.All that being said, I am not 100% sure of that decision, hence the TODO - I can be convinced.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with this as-is I think. We can always look into it again if it becomes an issue.