-
Notifications
You must be signed in to change notification settings - Fork 788
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
[3.2][new feature] little native language system (internationalization, i18n) #582
Comments
Hi Dominic, in generell it's a good feature, but I think it might be better to keep the focus on the login system and don't integrate any features that are related to the login process! In the old php-login process there was a internationalization feature but this made things much more complicated. Maybe, if it's extremely easy and a fully independet class: Can you show a little bit of code ? Thanks & have a nice day |
I love the simplicity of your code! Good stuff, this should definitly go into the project! Let's discuss this a little bit, maybe there are pros / cons and other have different opinions. My suggestions:
Good feature! Thanks for coming up with this proposal! |
Thanks! I even removed the switch, so the language-file is searched just by the content of the user_lang session (with strip_tags). To detect the language I got this in the constructor of app/core/controller.php
Parts of this are from stackoverflow. But I would need to search for a link. |
I found a smaller problem with my solution. If you got multiple language files, you always need to get sure that each language file contains every text. Otherwise there will be an empty place on the site. Example: This could be solved by requirering the language array, check the array for the entry and load the standard language if it's empty. |
Hey, I've linked this feature from the project's readme in case somebody wants to implement this. Hope if it's okay for you when i close this ticket. |
I know this is old. I've made something like this and copy now some of your code. About missing text: I've something different for this:
Become ->
So, you load main language and override only exist strings. But really don't know which is better, double request or a check for each string call? Thanks for your code! |
Hello, I use huge login for my application. I would like to use several languages(tongues) in the application. Somebody has a directory containing everything. Return array ("FEEDBACK_UNKNOWN_ERROR" = > " Unknown error occurred! ", "FEEDBACK_DELETED" = > " Your account has been deleted. ", "FEEDBACK_ACCOUNT_SUSPENDED" = > " Account Suspended for ", |
Remember to check if texts exist! if (!self::$texts) |
Hey,
As you made it possible to load text with Text::get(), I created a very simple language system with it. I let the user choose the language while registering and save it to the database. Then I'm just checking which file needs to be loaded in the text class.
Additionally I'm reading out $_SERVER['HTTP_ACCEPT_LANGUAGE'] to show unregistered users the site in their prioritized language (if available).
Are you interested in this simple solution? Because you said it's not really needed some time ago.
I can't create a pull-request now as my version of huge is too different, that's why I'm asking.
The text was updated successfully, but these errors were encountered: