Open bagus-repository opened 5 years ago
@bagus-repository I prefer the Laravel Localization way. It would be great if you follow Laravel approach while contributing.
I can help with Russian language
Hi, I can start to implement Laravel localization, I think the first thing to do is to extract all labels, put them on corresponding files inside resources/lang, and modify all views to consume the proper localization files. I will create first the localization for english and from there we can add any language we want, I can help with spanish.
This is a lot of work, it will take me some time to finish all by myself, I would like some one else to be able to help me with this, but for now I'll assume I'll be working alone on this. Please let me know if there are any considerations, suggestions or if I can start with this?
Thank you
@gerpollo2000 it would be great and we appreciate any community help. Yes this is a lot of work. Hope we can join you whenever it is possible.
I got some progress on dev branch (not pushed yet):
Screenshot preview: https://pasteboard.co/InhA6E8.png Demo server: http://45.79.0.114/Unifiedtransform/public/home (use default test credentials for login)
I'm having some issues with strings having apostrophe (') like Mother's name, Parent's designation, etc...
Most of the work is done, just need to adjust the problematic strings and go through all pages as they were modified. Any feedback is welcome
@gerpollo2000 thank your for making (extracting) in-system label progress, i am sorry if i can not work in this yet,
apostrophe(') can be written with \ (backslash) in a string
'failed' => 'Identitas\' tersebut tidak cocok dengan data kami.',
Hi,
This what I started to do. I prefer of course the Laravel localization. I worked long time ago on big Symfony2 projects and we always used the way adviced by the framework.
Here are my suggestions:
Add a file for all translation views keys called views.php
in resource folder:
And replicate in different folders for all languages. The folder MUST be iso code languages
In this views.php
file this content.:
<?php
return [
'auth' => [
'login' => [
'email_or_phone_number' => 'E-Mail Or Phone Number',
'login' => 'Login',
'password' => 'Password'
]
],
'components' => [
'nav_bar_top' => [
'login' => 'Login'
],
],
'master_home' => [
'dashboard' => 'Dashboard',
'manage_school' => 'Manage School'
],
'school' => [
'admin_list' => [
'manage_school' => 'Manage School'
]
],
'welcome' => [
'home' => 'Home',
'login' => 'Login',
'subtitle' => 'Makes managing schools an amazing experience'
]
];
For french example:
<?php
return [
'auth' => [
'login' => [
'email_or_phone_number' => 'E-Mail ou Numéro de téléphone',
'login' => 'Connexion',
'password' => 'Mot de passe',
],
],
'components' => [
'nav_bar_top' => [
'login' => 'Connexion'
],
],
'master_home' => [
'dashboard' => 'Tableau de board',
'manage_school' => 'GĂ©rer l\'Ă©cole',
],
'school' => [
'admin_list' => [
'manage_school' => 'GĂ©rer l\'Ă©cole',
],
],
'welcome' => [
'home' => 'Accueil',
'login' => 'Connexion',
'subtitle' => 'Faire de la gestion des écoles une expérience incroyable',
],
];
The file name will determine how we will use it in the naming. Each time we have an array in an array for the definition of translation, we will add a "." for the usage. Nothing more to do.
Usage in templates:
@section('title', trans('views.auth.login.login'))
<div class="form-group">
<div class="col-md-8 col-md-offset-4">
<button type="submit" class="btn btn-primary">
{{ __('views.auth.login.login') }}
</button>
</div>
</div>
To easily handle translation, I strongly suggest to add to the project this dependency https://github.com/chriskonnertz/translation-factory Easy to install
To change the locale and see translations, change in config/app.php
'locale' => 'fr'
.
At the end, it will be interesting to have a language selector or a different routes naming : https://medium.com/@gabrieladeniji/how-to-easily-set-up-multiple-languages-for-your-web-app-laravel-localization-78c991eaa42c
Hope this help
Hi,
Thanks for the feedback, in summary:
@changeweb I'm ready to push changes to dev branch and create Pull request but I don't have permissions, hope you can guide me on this please:
Thanks!
@gerpollo2000 just create a Pull Request without trying to push changes to Master branch.
But ensure your code base is up to date with latest master branch before creating PR. Otherwise it may conflict with existing code.
I'm stuck, this is my first contribution to Github so I'm kind of lost. I need some more guidance please:
I'm trying to push my code to 'dev_for_new_features' branch but I can't
I suppose I have to push my code before creating the PR right?
For checking my code is up to date with master branch I should merge master to dev branch and solve any possible conflicts, right?
@gerpollo2000 follow these steps: (I guess you are working with cloned repo)
I suggest you to use any Git GUI like (Github Desktop, Git Kraken) for easy Git functions.
Hi,
I'm working on translating into fr-FR and I'm wondering about some acronyms:
Can you explain what is a GPA system?
@floviolleau AT -> attendance, GPA -> Grade Point Average, taka -> currency of Bangladesh(replace it with France currency), Srl -> Serial may be.
Thanks!
A liitre bit more ;)
What is 'CT Full Marks', 'OB', 'SB', 'CT+Q'?
Can you please explain a bit GPA because I'm not familiar with?
Thanks
CT -> Class Test, OB -> Objective (MCQ), SB -> Subjective(Written), Q -> Quiz, GPA -> https://en.wikipedia.org/wiki/Grading_in_education
Hi, i'm trying to translate to german. i'm not a programmer at all but can read through code and get the points. the information from @floviolleau and @gerpollo2000 are quite helpful, but i'm a bit lost now.
i found the path to the lang folder \Unifiedtransform\resources\lang
but there is just the spanish .json
file.
my testapp is running in english right now, so i just want to be sure im in the correct folder?!
Hallo,
Yes, you're in the right folder, inside Unifiedtransform\resources\lang, you need to create the folder
de_DE
and inside you need to add the same 4 php files that are inside "en" folder, but with the corresponding german translation
Also, inside Unifiedtransform\resources\lang folder you need to create the
de_DE.json file, clone in there the es_MX.json file, replace all spasnish translations with german ones.
Once you're done edit the config/app.php file and set the variable locale => 'de_DE'
Hope it works
thanks @gerpollo2000 will try right now!
where is the english file located?!
Trying to access array offset on value of type null (View: /path/to/home/Unifiedtransform/resources/views/components/user-profile.blade.php) (View: /path/to/home/Unifiedtransform/resources/views/components/user-profile.blade.php)
Get this error when i edit Teachers. Someone can help here?
Edit:
Guess i'm with an incompatible phpversion PHP 7.4.2
- is PHP 7.3
supported?
Hi, it would be good to be able to set the language system-wide, and also to override that for each school. I suppose this would mean to set the language into some DB tables, like schools and I don't know if there is a table for global settings.
Currently, AFAIK, you have to set language on /var/www/config/app.php which is not so convenient, even less if you are using docker.
The same applies to timezone, I think.
After that, it would also be good to be able to set the language on the user profile (e.g. for some foreign teacher), and on the course (e.g.: for some foreign language course).
I'm evaluating this software for use on a school, idk if it's adecuate yet, but I'd like to thanks anyway for sharing your work.
Regards!
@esale any PR is appreciated.
@gerpollo2000 thank your for making (extracting) in-system label progress, i am sorry if i can not work in this yet, apostrophe(') can be written with \ (backslash) in a string
'failed' => 'Identitas\' tersebut tidak cocok dengan data kami.',
You can also change apostrophe (') to quotation marks ("), as like:
'failed' => "Identitas' tersebut tidak cocok dengan data kami.",
After the first full translation, all next ones will be lot easier...
Need some help @gerpollo2000 ?
At the end, it will be interesting to have a language selector or a different routes naming : https://medium.com/@gabrieladeniji/how-to-easily-set-up-multiple-languages-for-your-web-app-laravel-localization-78c991eaa42c
By the way, I think I already have a code to change user settings for languages... I'm just studying code project first before make any changes.
Is your feature request related to a problem? Please describe. I think if there is translation support will be great, our school society not all good in english
Describe the solution you'd like I hope if there is a translation feature, in-system either in-database multi language content support
Describe alternatives you've considered Or, give config to load in-system translation on installation step and leave the in-database language single language.
Additional context Here multi languages database design proposal, using the third approach : Multi language database design And for the in-system localization just follow the Laravel way Laravel Localization
I am ready for contributing on translation to Indonesia (ISO code: ID) and code or design pattern, but i am still learning laravel, however a great Open Source Application đź‘‹