-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Multilanguage Support via gettext #1
Comments
Take a look at https://github.com/sabas/msgfmtPHP , you shouldn't use directly gettext because Apache caches translations. Also see the approach from Wordpress (which I couldn't use due to license conflict). |
I'd be happy to help. I'm just not very experienced with PHP and github, so don't expect a lot from me. Especially no elegant solutions. :) @gautiermichelin @sabas |
I Have An arabic translated copy of 1.7.0 and I can help (translate/add language engine) the latest copy |
Hi. In my projects, I personally just create a globally visible function called "t", which handles the translation. The arguments are similar to printf, so you get either a string, or a string containing variables like "%s", "%i" etc and the arguments. I suppose you create one additional "translation.php" which introduces this function and change all code to just "require_once" this file and use the function. Using "t" as name has also the advantage, that there is not much to write. I'd use the english version as "key", so the code stays readable and if some translations are missing, just the english version is printed. |
If you like my idea, please clone my "feature-generic-translation" branch, copy the "include/i18n/en_US" folder to your locale and translate the file "include/i18n/xx_XX/lang.php". Currently only the guest login-page is translated, but feel free to update other templates in "include/client" as I did in the commit. Basically just change "Text to be translated" to "". That's it. now you can add to your "lang.php": "Text to be translated" => "your translation" |
This is finally implemented in #1096 and slated for osTicket 1.9.3. Thanks again for everyone's help making this a reality |
Safe to presume that you meant 2.10? |
This addresses an issue reported on the Forum where when adding a new Queue Sort an error of `Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, string given` is thrown. This is due to passing the wrong arguments to the `QueueSort::update()` method. This corrects the arguments to `$vars, $errors` to resolve the error.
…lude/class.session.php:314 To prevent following error: PHP Fatal error: Uncaught Error: Call to a member function getId() on bool in /.../include/class.session.php:314 Logged back trace: PHP Fatal error: Uncaught Error: Call to a member function getId() on bool in /.../include/class.session.php:314 Stack trace: #0 /.../include/class.session.php(336): osTicket\\Session\\AbstractSessionStorageBackend->getRecord() osTicket#1 /.../include/class.session.php(281): osTicket\\Session\\AbstractSessionStorageBackend->update() osTicket#2 [internal function]: osTicket\\Session\\AbstractSessionHandler->write() osTicket#3 [internal function]: session_write_close()
See https://github.com/thane-de-loth/osTicket-1.7/commit/40a89ee3eac92ed28bc9853c742908b4575883e2
and osTicket/osTicket-1.7#509
Need to check and compare with @thane-de-loth pull request :
This issue is meant to prepare for i18n, not starting translation, which comes after.
The text was updated successfully, but these errors were encountered: