ElkArte Community

Project Support => Support => Topic started by: radu81 on November 06, 2018, 05:09:58 pm

Title: Custom translation
Post by: radu81 on November 06, 2018, 05:09:58 pm
I need to change some translations specific for my forum, I know I can edit the translations from ACP or directly editing the files in themes/default/languages/ but this is not what I need, since next time I will update the translation I will loose my "custom translations".
Is there a way in elkarte to create a custom file with only the strings I want to change? or any other alternative?
Title: Re: Custom translation
Post by: tino on November 06, 2018, 06:08:42 pm
You can include them via something like a preload hook at set them in the right place or if it’s set later in the loader one of the final hooks should also work to overwrite any of them.
Title: Re: Custom translation
Post by: ahrasis on November 07, 2018, 12:42:27 am
Try adding the in english/Addons.english.php for english. You can do the same for other language. I think that should overwrite default settings. I think...   ;D
Title: Re: Custom translation
Post by: Jorin on November 07, 2018, 01:05:27 am
Use a different language other than the ones in the update package.  ;D

With every update I have to check all the language files and translate the new lines. Not funny also.  :-X
Title: Re: Custom translation
Post by: emanuele on November 07, 2018, 02:44:27 am
Quote from: ahrasis – Try adding the in english/Addons.english.php for english. You can do the same for other language. I think that should overwrite default settings. I think...   ;D
^^ This should work. (Unless it's broken xD )
Title: Re: Custom translation
Post by: radu81 on November 07, 2018, 08:43:29 am
I like the idea of using a custom file like Addons.italian.php, but it doesn't work for me, I still see the original translations. :(
Can anyone test this and confirm is working?
Title: Re: Custom translation
Post by: emanuele on November 07, 2018, 04:09:40 pm
What string are you trying to replace?
Title: Re: Custom translation
Post by: radu81 on November 08, 2018, 08:47:10 am
The file Addons.language.php is considered by elkarte, the first time I created it I forgot to put in the begging "<?php" and this caused a white page with some warnings and errors.

I did a test with a couple of casual strings from Admin.language.php
Title: Re: Custom translation
Post by: ahrasis on November 08, 2018, 09:27:23 am
I think you will still need to backup the Addons.english.php, if you modify it, before running full EA updates/upgrades, just in case, as the empty version of that file exists in the full installation/upgrade package.
Title: Re: Custom translation
Post by: radu81 on November 08, 2018, 09:52:26 am
Thanks for answering @ahrasis‍ but I I'm not sure I understand what should I do
Title: Re: Custom translation
Post by: ahrasis on December 01, 2018, 12:38:22 am
I mean Addons.english.php file comes with full EA package and you need to back up yours if you make changes to it so that if you run a upgrade or update or fix using the full EA package, that file will be replaced.
Title: Re: Custom translation
Post by: radu81 on December 01, 2018, 04:12:37 am
Good to know, but it did not work for me. 
Title: Re: Custom translation
Post by: ahrasis on December 02, 2018, 02:46:04 am
Then I think this should be noted as a bug. @emanuele @Spuds what do you think ?
Title: Re: Custom translation
Post by: Jorin on December 03, 2018, 02:45:33 am
I think an upgrade package should not overwrite my addons language file. Thanks for the hint!  :o