How to create language pack for Joomla! 1.5 extension

General questions regarding the use of languages in Joomla! 1.5.

Moderator: General Support Moderators

Locked
User avatar
yvolk
Joomla! Guru
Joomla! Guru
Posts: 979
Joined: Thu Jun 01, 2006 1:52 pm
Location: Moscow, Russia
Contact:

How to create language pack for Joomla! 1.5 extension

Post by yvolk » Tue Mar 18, 2008 7:33 am

I'm developing multilingual Joomla! 1.5 extension: yvComment. It is translated into 15 languages already and it became obvious, that extension itself and each of its translations should live their own lifes (and be maintained by different people, like e.g. Joomla!'s 'full' ('site' and 'administrator') language packs),
which means, that we must have sort of 'language pack for Joomla! extension'?!

I couldn't find any authoritative example of such thing, so my question to community is:
How to create language pack for Joomla! 1.5 extension properly?
Last edited by yvolk on Sat Mar 22, 2008 12:50 pm, edited 1 time in total.

User avatar
ot2sen
Joomla! Master
Joomla! Master
Posts: 10381
Joined: Thu Aug 18, 2005 9:58 am
Location: Hillerød - Denmark
Contact:

Re: How to create language pack for Joomla! 1.5 extension

Post by ot2sen » Fri Mar 21, 2008 11:38 am

Hi yvolk,

Had a quick look at your extension the other but never got back here with a reply. Will give it a shot now ;)

Actually its quite simple. You will need an install.xml for a site package and another install.xml for an administration package.
I did run a little in circles until I realized that your extension pick up admin the admin strings from the frontend file too.
So my example for admin also includes an com_yvcomment.ini for admin that dont seem to be needed in your case.

For admin I created an install.xml like below and packaged with the com+plugin files:
<?xml version="1.0" encoding="utf-8"?>
<install version="1.5" client="administrator" type="language">
<tag>da-DK</tag>
<version>1.0</version>
<creationDate>2008-18-03</creationDate>
<author>Ole Bang Ottosen</author>
<name>Danish</name>
<authorEmail>[email protected]</authorEmail>
<authorUrl>http://www.ot2sen.dk</authorUrl>
<copyright>Copyright (C) Ole Bang Ottosen. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-2.0.html</license>
<description>Dansk oversættelse til yvComment site</description>
<files>
<filename>da-DK.com_yvcomment.ini</filename>
<filename>da-DK.plg_content_yvcomment.ini</filename>
</files>
<params />
</install>
And then created an install.xml for the frontend package and zipped with the com file:
<?xml version="1.0" encoding="utf-8"?>
<install version="1.5" client="site" type="language">
<tag>da-DK</tag>
<version>1.0</version>
<creationDate>2008-18-03</creationDate>
<author>Ole Bang Ottosen</author>
<name>Danish</name>
<authorEmail>[email protected]</authorEmail>
<authorUrl>http://www.ot2sen.dk</authorUrl>
<copyright>Copyright (C) Ole Bang Ottosen. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-2.0.html</license>
<description>Dansk oversættelse til yvComment site</description>
<files>
<filename>da-DK.com_yvcomment.ini</filename>
</files>
<params />
</install>
Both of these packages can now be installed using the standard joomla!-installer.
Attached drafted da-DK files (still holding english text in ini).
*Looks like the da-DK.com_yvcomment.ini is not being used in admin and therefore not needed.
da-DK.com_yvcomment-admin.zip
da-DK.com_yvcomment-site.zip
Hope this helped :)
You do not have the required permissions to view the files attached to this post.
Ole Bang Ottosen
Dansk frivillig Joomla! support websted - joomla.dk
OpenTranslators Core Team opentranslators.org

User avatar
yvolk
Joomla! Guru
Joomla! Guru
Posts: 979
Joined: Thu Jun 01, 2006 1:52 pm
Location: Moscow, Russia
Contact:

Re: How to create language pack for Joomla! 1.5 extension

Post by yvolk » Fri Mar 21, 2008 1:54 pm

ot2sen wrote:Had a quick look at your extension the other but never got back here with a reply. Will give it a shot now ;)
Thank you, ot2sen! I'll test this approach and report results to this thread.
Next task for me will be to figure out, how to organize extension's Joomlacode project for lots of language packs and to give translators access to their language packs...
ot2sen wrote:*Looks like the da-DK.com_yvcomment.ini is not being used in admin and therefore not needed.
It is used by Joomla!'s core: in "Menu Manager", - to translate Menu item types and their descriptions...

User avatar
yvolk
Joomla! Guru
Joomla! Guru
Posts: 979
Joined: Thu Jun 01, 2006 1:52 pm
Location: Moscow, Russia
Contact:

Re: How to create language pack for Joomla! 1.5 extension

Post by yvolk » Sat Mar 22, 2008 7:02 am

yvolk wrote:Thank you, ot2sen! I'll test this approach and report results to this thread.
Hi! I've tested above published files and found, that:
- Package is installed Ok, but it doesn't appear anywhere as installed package. So it can't be uninstalled :( .
- Moreover, once I installed the package, I can't update it: I'm getting message, that 'There is already a folder called '...\language\da-DK\da-DK.com_yvcomment.ini' '

So, unfortunately, this is not a solution for 'Language pack for Joomla! 1.5 extension' task :'(

I don't like any 'workarounds', but it seems, that for 'language pack' I have to create some fake extension, e.g. plugin 'yvcomment_da-DK', that has nothing, except language files... But, of cause, this is not smart.

What do you think?

User avatar
ot2sen
Joomla! Master
Joomla! Master
Posts: 10381
Joined: Thu Aug 18, 2005 9:58 am
Location: Hillerød - Denmark
Contact:

Re: How to create language pack for Joomla! 1.5 extension

Post by ot2sen » Sat Mar 22, 2008 4:07 pm

Can only agree that it can be tricky to find the better approach to this. The standard installer might not be perfectly fitted for handling 3rd party language extensions at this point, but at least its improved a lot since the manual 1.0.x upload approach.

Tried a few tests installing/uninstalling yvcomment and noticed that site language files did get removed, but admin language files stayed after uninstalling. (bug?)
So when trying to install the local admin language pack, after having reinstalled yvcomment, it returned an error.

That seem to be fixable by doing a slight change to the install.xml for upgrades.

Code: Select all

<install version="1.5" client="administrator" type="language">
to:

Code: Select all

<install version="1.5" method="upgrade" client="administrator" type="language">
then the upgraded language pack installs just fine on top of the files that wasnt deleted during uninstall.

Dunno if you know the extension 'Translation Manager' which is also quite helpful for handling local translations of a 3rd party extension?
http://extensions.joomla.org/component/ ... Itemid,35/
This extension do actually get the info from your en-GB.com_yvcomment and let the user create a corresponding local translation in an easy way. Handy tool for first time translation into new languages.
Ole Bang Ottosen
Dansk frivillig Joomla! support websted - joomla.dk
OpenTranslators Core Team opentranslators.org

Jonathan Cameron
Joomla! Apprentice
Joomla! Apprentice
Posts: 34
Joined: Wed Sep 12, 2007 7:55 pm
Location: Pasadena, California

Re: How to create language pack for Joomla! 1.5 extension

Post by Jonathan Cameron » Sat Mar 22, 2008 8:46 pm

So it seems like there are currently two ways to construct language packs for extensions:

1. Make an installation package with an appropriate install.xml file as outlined above.
This has a few drawbacks:
* The Joomla! language manager/installer/uninstaller has no way to track it so it can be uninstalled easily.
* You need a separate installation package for the frontend and backend.
* It is not clear how to get translated help files installed in the right place in the administrative back end.

2. Make a zip file that is unzipped in the site root directory and puts all files where they need to go.
This works well, but again there is no way for Joomla to know about these files and uninstall them for you.
It also is not quite as simple for admins to install.

If you include the translations in your extension, Joomla! complains about not being able to install the languages that are not already installed as a core language in Joomla itself. This is irritating and confusing to the admin (many of whom are somewhat inexperienced these days). This, and having many translations, is pushing me towards figuring out how to create language packs for extensions.

I think that we should consider putting together a white paper that proposes making language packs for extensions first class language packages that are tracked by Joomla! and can be uninstalled cleanly by Joomla! itself.

-Jonathan

User avatar
yvolk
Joomla! Guru
Joomla! Guru
Posts: 979
Joined: Thu Jun 01, 2006 1:52 pm
Location: Moscow, Russia
Contact:

Re: How to create language pack for Joomla! 1.5 extension

Post by yvolk » Sun Mar 23, 2008 3:10 pm

I came to conclusion, that the best way "to create language pack for Joomla! 1.5 extension" is the third way ;) :
to create "dummy plugin" package, which purpose is to give user ability:
- to install and uninstall language files for "real" (parent) extension, using Joomla! installer;
- to see, which languages of extension are installed (each language has it's own line in the list of plugins);
- to see the version of each language pack (version of language pack is version of extension, which language files were translated) - in the "Extension Manager->Plugins".

I had to make only one change in my extension: I've got rid of 'site' language files (I moved all localizable strings to 'administrator' language files), because plugin installer can't install 'site' language files :(
- but I've got another thing as a result: now I have only one language pack file for each language 8)

So, install.xml file is still very simple:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE install SYSTEM "http://dev.joomla.org/xml/1.5/plugin-install.dtd">
<install type="plugin" group="content" version="1.5.0">
	<name>yvCommentLanguagePack_da-DK</name>
	<creationDate>2008-03-23</creationDate>
	<author>Yuri Volkov</author>
	<authorEmail>Email -> Visit the website:</authorEmail>
	<authorUrl>http://yurivolkov.com/Joomla/yvComment/index_en.html</authorUrl>
	<copyright>(c) 2007-2008 yvolk (Yuri Volkov), http://yurivolkov.com. All rights reserved.</copyright>
	<license>GPL</license>
	<version>1.6.6</version>
	<description>
		This is Danish language pack for yvComment extension.
		Don't enable this plugin.
		See yvComment's Homepage [url]http://yurivolkov.com/Joomla/yvComment/index_en.html[/url] for more information.
	</description>

	<files>
		<filename plugin="yvCommentLanguagePack_da-DK">yvCommentLanguagePack_da-DK.php</filename>
	</files>

	<languages>
		<language tag="da-DK">da-DK.plg_content_yvcomment.ini</language>
		<language tag="da-DK">da-DK.com_yvcomment.ini</language>
	</languages>
</install>
As you may see in the code above, I had to add only one (dummy) plugin file to the package: yvCommentLanguagePack_da-DK.php
-It is required by Joomla! installer.

So, maybe this is good solution for the time being (until Joomla! will have the same support for "language" package as it has for "plugin" package).
See full package attached.
You do not have the required permissions to view the files attached to this post.

User avatar
mcsmom
Joomla! Exemplar
Joomla! Exemplar
Posts: 7897
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York
Contact:

Re: How to create language pack for Joomla! 1.5 extension

Post by mcsmom » Tue Mar 25, 2008 9:48 am

WHy is it that the other languages aren't installed if you haven't installed a language pack for that language? First, maybe you happen to work in reverse order. Second, a full language pack for the language in the extension might not even exist.
Third, I think I could even see a use case where you need an extension in a language even if the rest of the site doesn't have that language, although that is obviously something more complicated.
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.

User avatar
yvolk
Joomla! Guru
Joomla! Guru
Posts: 979
Joined: Thu Jun 01, 2006 1:52 pm
Location: Moscow, Russia
Contact:

Re: How to create language pack for Joomla! 1.5 extension

Post by yvolk » Tue Mar 25, 2008 10:31 am

mcsmom wrote:WHy is it that the other languages aren't installed if you haven't installed a language pack for that language?
This is how Joomla! works :) ,
this was reported many times in yvComment's forum. Error messages themselves are considered normal, see this Tracker Item: [#8710] JInstaller generates error messages while installing language files of multilingual extension, if corresponding Joomla language packs don't exist

User avatar
mcsmom
Joomla! Exemplar
Joomla! Exemplar
Posts: 7897
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York
Contact:

Re: How to create language pack for Joomla! 1.5 extension

Post by mcsmom » Tue Mar 25, 2008 6:32 pm

No, I know that's how it works, I'm asking why it makes sense for it to work that way.
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.

User avatar
yvolk
Joomla! Guru
Joomla! Guru
Posts: 979
Joined: Thu Jun 01, 2006 1:52 pm
Location: Moscow, Russia
Contact:

Re: How to create language pack for Joomla! 1.5 extension

Post by yvolk » Wed Mar 26, 2008 7:31 am

mcsmom wrote:No, I know that's how it works, I'm asking why it makes sense for it to work that way.
Some time ago I asked the same questions about sense ("semantics") in other thread (see the SEF generates different urls message and below)
yvolk wrote:To decide, what's bug, and what's a feature, we should return to the question "What Joomla! is?". And Joomla!'s problem is in absence of defined and documented "architectural decisions" for such fundamental questions like "What is a page in Joomla!"...
Yet, I didn't find place, where (and with whom) discuss such conceptual questions in order to influence Joomla!

User avatar
yvolk
Joomla! Guru
Joomla! Guru
Posts: 979
Joined: Thu Jun 01, 2006 1:52 pm
Location: Moscow, Russia
Contact:

Re: How to create language pack for Joomla! 1.5 extension

Post by yvolk » Sat Mar 29, 2008 8:19 pm

16 language packs for my extension created, see yvComment at JoomlaCode.
There is also special, 'English language pack', that is template package to be used by translators to create additional language packs for yvComment extension. The yvCommentLanguagePack_en-GB.xml file of this package contains instructions for transtlators: How to create new language pack.

tstahl
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Sat Jun 30, 2007 8:42 am
Location: Germany

Re: How to create language pack for Joomla! 1.5 extension

Post by tstahl » Sat Apr 05, 2008 6:04 am

Have you tried to use a new install group like:

<install type="plugin" group="dummy" version="1.5.0">

This will create a new plugin subdirectory "dummy" where the plugin will be installed.
This plugin is never loaded whether it is published or not since it is a unknown plugin group to Joomla.

User avatar
yvolk
Joomla! Guru
Joomla! Guru
Posts: 979
Joined: Thu Jun 01, 2006 1:52 pm
Location: Moscow, Russia
Contact:

Re: How to create language pack for Joomla! 1.5 extension

Post by yvolk » Mon Apr 07, 2008 6:48 am

tstahl wrote:Have you tried to use a new install group like:

<install type="plugin" group="dummy" version="1.5.0">

This will create a new plugin subdirectory "dummy" where the plugin will be installed.
This plugin is never loaded whether it is published or not since it is a unknown plugin group to Joomla.
Thank you for suggestion!
To be honest, I forgot about this feature. Maybe I should choose "language" install group :-\
But, taking into account, that in any case, this is temporary workaround of Joomla! "language extension" limitations, there is no much difference... My main goal was to find safe solution...

sekhar_sekhar
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Sat Jun 28, 2008 3:55 pm

Re: How to create language pack for Joomla! 1.5 extension

Post by sekhar_sekhar » Tue Jul 08, 2008 1:15 pm

Hi guys i want to show my site in two languages that means if i want to show it in english then i will select the language as english and if i want to show it on my local language then i want to be in a position to switch the total language of the site from english to my local language.for this what should i do?
where should i get the language packs of any language?

User avatar
mcsmom
Joomla! Exemplar
Joomla! Exemplar
Posts: 7897
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York
Contact:

Re: How to create language pack for Joomla! 1.5 extension

Post by mcsmom » Tue Jul 08, 2008 1:38 pm

This is completely unrelated to the topic of this tread.
sekhar_sekhar wrote:Hi guys i want to show my site in two languages that means if i want to show it in english then i will select the language as english and if i want to show it on my local language then i want to be in a position to switch the total language of the site from english to my local language.for this what should i do?
where should i get the language packs of any language?
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.

sekhar_sekhar
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Sat Jun 28, 2008 3:55 pm

Re: How to create language pack for Joomla! 1.5 extension

Post by sekhar_sekhar » Tue Jul 08, 2008 1:43 pm

Its ok mr i will write in my own forum
sry if i disturb you

roon
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Mon Mar 05, 2007 2:46 pm

Re: How to create language pack for Joomla! 1.5 extension

Post by roon » Tue Jul 08, 2008 4:44 pm

I've been trying to learn joomla for the past couple of years and am not in any way equal to either of your talents but perhaps I can make a suggestion that you could look into. I am building a multilingual (bilingual site for now) in joomla 1.5 with virtuemart SOBI2 as one of the components. I think if you look at the system that SOBI2 uses it could be the answer. At first I misunderstood their system and tried to upload their language pack with the J1.5 installer but it refused to recognize the xml file which was present. This was a Polish SOBI2 language file and then I realized that the admin of SOBI2 has an uploader to install language packs and the language file uploaded perfectly. I am very impressed with the SOBI component and the support web site has quite an active forum compared to many other components and the two guys that look after it seem to be responsive and helpful. I hope this is helpful to you and good luck in your endevour.

User avatar
Alfred
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 142
Joined: Fri Aug 04, 2006 11:28 am
Contact:

Re: How to create language pack for Joomla! 1.5 extension

Post by Alfred » Mon Jul 21, 2008 5:39 pm

hi yvolk,

Thanks for suggesting to make a 'dummy' plugin, at least that makes it a bit better to manage extension translations.

I also put all the localized strings into 1 administrator ini, but how do I make the frontend to see those strings ?
My Backend gets translated just fine, the frontend still seems to be looking for the translations in a different location.

User avatar
yvolk
Joomla! Guru
Joomla! Guru
Posts: 979
Joined: Thu Jun 01, 2006 1:52 pm
Location: Moscow, Russia
Contact:

Re: How to create language pack for Joomla! 1.5 extension

Post by yvolk » Mon Aug 04, 2008 8:57 am

Alfred wrote:hi yvolk,

Thanks for suggesting to make a 'dummy' plugin, at least that makes it a bit better to manage extension translations.

I also put all the localized strings into 1 administrator ini, but how do I make the frontend to see those strings ?
My Backend gets translated just fine, the frontend still seems to be looking for the translations in a different location.
In the code, I'm forcing Joomla! to load translations from administrator ini file, see 'components\com_yvcomment\helpers.php':

Code: Select all

$lang = & JFactory :: getLanguage();
$lang->load('com_yvcomment', JPATH_ADMINISTRATOR);


Locked

Return to “Language - Joomla! 1.5”