Giter Site home page Giter Site logo

Comments (24)

gerpollo2000 avatar gerpollo2000 commented on May 18, 2024 2

Hi,

Thanks for the feedback, in summary:

  • Apostrophes were added a backslash (on phps only)
  • Instead of views.php strategy files I used the Strings as keys strategy.
  • I liked the previous strategy because I found it has 1) simpler file structure (json), 2) strings on php files remain in original english (there's no need to add/update en.json), 3) no language keys creation needed.
  • For each translation/locale a json file must be added on /resources/lang folder with its ISO code as file name.
  • To facilitate comparison when adding new elements between locales, I added the Strings in alphabetical order (hope this keeps that way)
  • According to the context where the translation was invoked (jquery, javascript, html, directives) I had to use @lang, trans(), __() and @JSON( __()) functions. The most used was @lang
  • I added translation file es-MX.json
  • I tested that all pages were working with all profiles (student, teacher, etc...) in spanish and english. Attendance and Payment history not working from menu in any language, I think I read previously this was work in development?
  • Not all is already translated, I thing like 90% was translated, but things like placeholders, messages in dataTables, profiles names (teacher, student, etc) and success/warning messages (like "Student added", "File uploaded", etc) are still pending
  • As @floviolleau mentioned it would be good to have the language selector and the translation factory, so still pending.... locale can be changed on config/app.php 'locale' => 'fr' as mentioned
  • Demo server still available for validation
  • If time allows I'll eventually continue with the pending tasks...

@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:

image

Thanks!

from unifiedtransform.

bogdantarasenkozp avatar bogdantarasenkozp commented on May 18, 2024 1

I can help with Russian language

from unifiedtransform.

gerpollo2000 avatar gerpollo2000 commented on May 18, 2024 1

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

from unifiedtransform.

changeweb avatar changeweb commented on May 18, 2024

@bagus-repository I prefer the Laravel Localization way. It would be great if you follow Laravel approach while contributing.

from unifiedtransform.

changeweb avatar changeweb commented on May 18, 2024

@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.

from unifiedtransform.

gerpollo2000 avatar gerpollo2000 commented on May 18, 2024

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

from unifiedtransform.

bagus-repository avatar bagus-repository commented on May 18, 2024

@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.',

from unifiedtransform.

floviolleau avatar floviolleau commented on May 18, 2024

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:
image
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:

  • for sections:
    @section('title', trans('views.auth.login.login'))
  • for regular text:
<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

from unifiedtransform.

changeweb avatar changeweb commented on May 18, 2024

@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.

from unifiedtransform.

gerpollo2000 avatar gerpollo2000 commented on May 18, 2024

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

image

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?

from unifiedtransform.

changeweb avatar changeweb commented on May 18, 2024

@gerpollo2000 follow these steps: (I guess you are working with cloned repo)

  1. Add and make Commit for the changes you made in your local repository.
  2. Compare your local repository Master branch to remote Master branch to find conflicts.
  3. Make PR to remote Master branch instead of dev_for_new_features branch. Since that branch is not currently maintained.

I suggest you to use any Git GUI like (Github Desktop, Git Kraken) for easy Git functions.

from unifiedtransform.

floviolleau avatar floviolleau commented on May 18, 2024

Hi,

I'm working on translating into fr-FR and I'm wondering about some acronyms:

  • what 'AT' stands for?
  • what 'GPA' stands for?
  • what 'taka' in 'Amount (taka)' stands for?
  • what 'Srl.' stands for?

Can you explain what is a GPA system?

from unifiedtransform.

changeweb avatar changeweb commented on May 18, 2024

@floviolleau AT -> attendance, GPA -> Grade Point Average, taka -> currency of Bangladesh(replace it with France currency), Srl -> Serial may be.

from unifiedtransform.

floviolleau avatar floviolleau commented on May 18, 2024

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

from unifiedtransform.

changeweb avatar changeweb commented on May 18, 2024

CT -> Class Test, OB -> Objective (MCQ), SB -> Subjective(Written), Q -> Quiz,
GPA -> https://en.wikipedia.org/wiki/Grading_in_education

from unifiedtransform.

xMasterChiefx avatar xMasterChiefx commented on May 18, 2024

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?!

from unifiedtransform.

gerpollo2000 avatar gerpollo2000 commented on May 18, 2024

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

from unifiedtransform.

xMasterChiefx avatar xMasterChiefx commented on May 18, 2024

thanks @gerpollo2000 will try right now!

where is the english file located?!

from unifiedtransform.

xMasterChiefx avatar xMasterChiefx commented on May 18, 2024

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?

from unifiedtransform.

esale avatar esale commented on May 18, 2024

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!

from unifiedtransform.

changeweb avatar changeweb commented on May 18, 2024

@esale any PR is appreciated.

from unifiedtransform.

asathler avatar asathler commented on May 18, 2024

@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.",

from unifiedtransform.

asathler avatar asathler commented on May 18, 2024

After the first full translation, all next ones will be lot easier...

Need some help @gerpollo2000 ?

from unifiedtransform.

asathler avatar asathler commented on May 18, 2024

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.

from unifiedtransform.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.