Don't duplicate language files! (code available)

Translations - translations for Phoca extensions
horus68
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 06 May 2012, 03:27
Location: Portugal
Contact:

Don't duplicate language files! (code available)

Post by horus68 »

Is it possible to not duplicate language files (admin/site)

True this can be done by installer
But its not required and will be easier to all not to manage double files, specially when doing local updates or online translations.

There is an example on how to implement this:

Code: Select all

You should not need to copy the same file in the frontend. All you need is the joomla API :)
In your componentname.php file in the frontend you could do (example from hotspots):
With those 3 lines you can use the same admin language file in the frontend and you don't need to copy files around. 1 location = less things to maintain and less thinks can brake.
compojoom.com/forum/ctransifex/17455-identical-files-for-site-and-admin#19126

Please implement this on All Phoca extensions!

Keep Calm and Translate Joomla - sites.google.com/site/transjoomla
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Don't duplicate language files! (code available)

Post by Jan »

Hi, thank you for the info, unfortunatelly, there are more limits as it seems :-( If you manage over 1000 translation files and you get e.g. over 30% of the files not complete (e.g. lang-lang.com_component.ini is included and lang-lang.com_component.sys.ini not) and over 95% of the translations have no installation XML (so user install them per FTP) I really cannot imagine what happen if there will be four files insteand of two.

But anyway, thank you for the info, I will take a look at it to and will try to implement it for some of the next version (of course first I need to write the extensions for e.g. Joomla! 3 so they will exist at all)

Thank you, Jan
If you find Phoca extensions useful, please support the project
Post Reply