-
Notifications
You must be signed in to change notification settings - Fork 207
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
Adding support for L10n #12
Comments
There are now two pull requests. 🤦♂️ |
@pktharindu FYI I absolutely prefer using keys in a real application that needs full translations, especially combined with a tool like i18n-ally to see the real values inline with code lens, which mitigates the issue of not seeing the real string somewhat. However, I don't think that it's a very friendly way for most people, especially as we can't force tooling like that, as the majority of apps don't even need internationalisation support. The simpler approach of using the fill string is indeed less flexible, but in my opinion it's so much easier for people to understand exactly what it is, which I think is important in a preset. What're people's thoughts on this? |
@imliam In my opinion it should become clear when you read the english strings. |
@Wulfheart, I'm really sorry I didn't notice this issue sooner. 😬🙏 I too prefer using translation keys for apps that need full translations, but IMO most of the apps won't need it. Adding translation keys like this adds an overhead of a translation file and makes it a bit harder to understand for beginners. But I guess ultimately it is up to the authors and community to decide. Again, sorry about not noticing this sooner! |
No problem @pktharindu. This way I could post a meme. 🙈 |
@Wulfheart I'm not sure how we could do that cleanly without just outright duplicating all the views, any ideas? |
@imliam Is it possible to run some calculations when running the |
That would be my preferred option. By default, have the key-based translation strings in the views. We then have a flag in the UI command that is able to swap these out for the translated versions. Thoughts @Wulfheart @imliam? |
Like it. 👍🏻 |
I'd prefer it the other way around myself (the full strings by default because it's easier for people to understand, swapping out to the keys for people that actually want to translate stuff. We can do whatever custom logic is needed - see the |
In this case a lookup-array should be sufficient. The only caveat I can see is that this array has to stay up to date with the lang files. |
Can we not |
@danharrin I'm not sure if this is possible as the language files itself are a php array and not an external json file. |
@Wulfheart you can |
To do this, we'll have to map the translated strings to translation keys or vice versa. So any modification to the translations will require changes in two files, right? I'm not sure whether it is worth adding that kind of complexity just to achieve the same thing in different ways? 🤷🏼♂️ |
@pktharindu we could do this by using the keyed version in the view stubs, and then replacing it with the version stored in the lang file when it's copied over if the user requests. That way there's only one source of truth on our end for translations. |
I prefer the approach in #14. This is also what other presets use (see the Laravel default presets and the Tailwind presets). So I'd argue if you go with the keyed version, it wouldn't be Laravel-like, would it? :) It also wouldn't be in line with the rest of the presets in this namespace, so for consistencies sake all of those would have to be changed to keyed translations as well. |
@dakira we'll probably end up distributing the non-keyed version by default, and then supplying a flag to switch to the keyed version. |
We want this preset to lead the way with flexibility like that. |
I don't get why we need to add complexity or even flexibility to just several authentication blades. |
I noticed that everything is hardcoded text. I'm going to open a pull request with proper auth texts soon.
The text was updated successfully, but these errors were encountered: