The Joomla! Forum ™






Post new topic Reply to topic  [ 20 posts ] 
Author Message
PostPosted: Tue Mar 18, 2008 7:33 am 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Thu Jun 01, 2006 1:52 pm
Posts: 978
Location: Moscow, Russia
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.

Top
 Profile  
 
PostPosted: Fri Mar 21, 2008 11:38 am 
User avatar
Joomla! Master
Joomla! Master
Online

Joined: Thu Aug 18, 2005 9:58 am
Posts: 10077
Location: Hillerød - Denmark
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:
Quote:
<?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>info@ot2sen.com</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:
Quote:
<?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>info@ot2sen.com</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.
Attachment:
da-DK.com_yvcomment-admin.zip

Attachment:
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
redCOMPONENT Community Manager http://redcomponent.com
Personligt site www.ot2sen.dk
Dansk Joomla! support websted - joomla.dk


Top
 Profile  
 
PostPosted: Fri Mar 21, 2008 1:54 pm 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Thu Jun 01, 2006 1:52 pm
Posts: 978
Location: Moscow, Russia
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...


Top
 Profile  
 
PostPosted: Sat Mar 22, 2008 7:02 am 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Thu Jun 01, 2006 1:52 pm
Posts: 978
Location: Moscow, Russia
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?


Top
 Profile  
 
PostPosted: Sat Mar 22, 2008 4:07 pm 
User avatar
Joomla! Master
Joomla! Master
Online

Joined: Thu Aug 18, 2005 9:58 am
Posts: 10077
Location: Hillerød - Denmark
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:
<install version="1.5" client="administrator" type="language">

to:
Code:
<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
redCOMPONENT Community Manager http://redcomponent.com
Personligt site www.ot2sen.dk
Dansk Joomla! support websted - joomla.dk


Top
 Profile  
 
PostPosted: Sat Mar 22, 2008 8:46 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Sep 12, 2007 7:55 pm
Posts: 33
Location: Pasadena, California
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


Top
 Profile  
 
PostPosted: Sun Mar 23, 2008 3:10 pm 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Thu Jun 01, 2006 1:52 pm
Posts: 978
Location: Moscow, Russia
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:
<?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.


Top
 Profile  
 
PostPosted: Tue Mar 25, 2008 9:48 am 
User avatar
Joomla! Exemplar
Joomla! Exemplar

Joined: Thu Aug 18, 2005 8:43 pm
Posts: 7986
Location: New York
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!.


Top
 Profile  
 
PostPosted: Tue Mar 25, 2008 10:31 am 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Thu Jun 01, 2006 1:52 pm
Posts: 978
Location: Moscow, Russia
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


Top
 Profile  
 
PostPosted: Tue Mar 25, 2008 6:32 pm 
User avatar
Joomla! Exemplar
Joomla! Exemplar

Joined: Thu Aug 18, 2005 8:43 pm
Posts: 7986
Location: New York
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!.


Top
 Profile  
 
PostPosted: Wed Mar 26, 2008 7:31 am 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Thu Jun 01, 2006 1:52 pm
Posts: 978
Location: Moscow, Russia
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!


Top
 Profile  
 
PostPosted: Sat Mar 29, 2008 8:19 pm 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Thu Jun 01, 2006 1:52 pm
Posts: 978
Location: Moscow, Russia
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.


Top
 Profile  
 
PostPosted: Sat Apr 05, 2008 6:04 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Jun 30, 2007 8:42 am
Posts: 11
Location: Germany
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.


Top
 Profile  
 
PostPosted: Mon Apr 07, 2008 6:48 am 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Thu Jun 01, 2006 1:52 pm
Posts: 978
Location: Moscow, Russia
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...


Top
 Profile  
 
PostPosted: Tue Jul 08, 2008 1:15 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Jun 28, 2008 3:55 pm
Posts: 12
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?


Top
 Profile  
 
PostPosted: Tue Jul 08, 2008 1:38 pm 
User avatar
Joomla! Exemplar
Joomla! Exemplar

Joined: Thu Aug 18, 2005 8:43 pm
Posts: 7986
Location: New York
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!.


Top
 Profile  
 
PostPosted: Tue Jul 08, 2008 1:43 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Jun 28, 2008 3:55 pm
Posts: 12
Its ok mr i will write in my own forum
sry if i disturb you


Top
 Profile  
 
PostPosted: Tue Jul 08, 2008 4:44 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Mar 05, 2007 2:46 pm
Posts: 44
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.


Top
 Profile  
 
PostPosted: Mon Jul 21, 2008 5:39 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Fri Aug 04, 2006 11:28 am
Posts: 142
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.


Top
 Profile  
 
PostPosted: Mon Aug 04, 2008 8:57 am 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Thu Jun 01, 2006 1:52 pm
Posts: 978
Location: Moscow, Russia
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:
$lang = & JFactory :: getLanguage();
$lang->load('com_yvcomment', JPATH_ADMINISTRATOR);


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ] 



Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group