Dev Wiki - Language question

Joomla! Documentation Workgroup

Moderator: Documentation

Locked
ivo.apostolov
I've been banned!
Posts: 1868
Joined: Thu Aug 25, 2005 2:33 pm

Dev Wiki - Language question

Post by ivo.apostolov » Sun Jun 03, 2007 3:19 am

I was looking at that page:
http://dev.joomla.org/component/option, ... languages/

I have the following questions regarding it:
- What do you mean by "Building a Core Language Pack"? Do you mean a translation? And is someone working on creating it?
- Is someone working on "Building an Extension Language Pack"?

Thanks in advance for your attention

User avatar
Chris Davenport
Joomla! Ace
Joomla! Ace
Posts: 1370
Joined: Thu Aug 18, 2005 8:57 am
Location: Shrewsbury, Shropshire, United Kingdom

Re: Dev Wiki - Language question

Post by Chris Davenport » Sun Jun 03, 2007 8:24 am

Hi Ivo,

Yes, a Core Language Pack is a translation.  More information here: http://dev.joomla.org/content/view/43/67/

Regards,
Chris.
Chris Davenport

Davenport Technology Services http://www.davenporttechnology.com/
Lion Coppice http://www.lioncoppice.org/

ivo.apostolov
I've been banned!
Posts: 1868
Joined: Thu Aug 25, 2005 2:33 pm

Re: Dev Wiki - Language question

Post by ivo.apostolov » Sun Jun 03, 2007 8:27 am

Pretty nice mess :), is there something different that should be in the wiki (in comparison to the page you post) or the data was just not transfered yet?

User avatar
Chris Davenport
Joomla! Ace
Joomla! Ace
Posts: 1370
Joined: Thu Aug 18, 2005 8:57 am
Location: Shrewsbury, Shropshire, United Kingdom

Re: Dev Wiki - Language question

Post by Chris Davenport » Sun Jun 03, 2007 8:51 am

Well, until you asked the question I hadn't realised that that page existed. :)  Looks like at least some of the information ought to be in the wiki.  Since I've never needed to do a translation, it's an area I'm not familiar with.  Is the information correct?

Regards,
Chris.
Chris Davenport

Davenport Technology Services http://www.davenporttechnology.com/
Lion Coppice http://www.lioncoppice.org/

ivo.apostolov
I've been banned!
Posts: 1868
Joined: Thu Aug 25, 2005 2:33 pm

Re: Dev Wiki - Language question

Post by ivo.apostolov » Sun Jun 03, 2007 8:54 am

Yes it is correct and up to date and if we add some lines about:
http://extensions.joomla.org/component/ ... Itemid,35/
as it is a pretty GREAT tool for creation of core language packages we can have a really nice wiki entry.

User avatar
ianmac
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4784
Joined: Sat Sep 24, 2005 11:01 pm
Location: Toronto, Canada

Re: Dev Wiki - Language question

Post by ianmac » Sun Jun 03, 2007 8:43 pm

I don't know a lot about translations and stuff either, but it looks like the section under "The Joomla! Translation API" should be updated since patTemplate is deprecated.

Ian

User avatar
CirTap
Joomla! Explorer
Joomla! Explorer
Posts: 418
Joined: Mon Dec 12, 2005 5:34 pm

Re: Dev Wiki - Language question

Post by CirTap » Sun Jun 10, 2007 2:48 pm

Hi,
dunno if I can edit that page, but here's an update for that section. Please review grammar, spelling etc. before using it!

The Joomla! Translation API
Joomla! provides you with a static class named JText. This class has a number of methods but by far the one you will use most is the _ (underscore) method which is a mimic of the gettext shortcut that is built into php. It is used like this:
[php]
$title = JText::_( 'Users' );

[/php]

In the first example, the API will look for an alias in the language file called USERS. If it finds a match it will return the text associated with that alias and saves the result in the $title variable. If it doesn't find a match, it will simply return the text passed to it: "Users". In the second example we are using an alias for a long phrase. Note that the text passed to the method is not case sensitive.

In your template files you can use the very same JText class. As with any PHP code used inside templates you need to switch to PHP mode like in the 2nd example above:
[php]
:

[/php]

This example may generate the following output presuming english is the active language:

Code: Select all


<h2>FTP Configuration:</h2>
<p>Due to filesystem permission restrictions and PHP Safe Mode restrictions. 
For all users to utilize the Joomla! installers an FTP layer exists to handle filesystem manipulation.
<br />
<br />
Enter an FTP username and password with access to the Joomla! root directory, 
this will be the FTP account that handles all filesystem operations when Joomla! 
requires FTP access to complete a task.</p>

The two examples above perform exactly the same as the php examples. Note that using the patTemplate tags, we do see the relationship between the alias and the text for long phrases.
Last edited by CirTap on Sun Jun 10, 2007 2:53 pm, edited 1 time in total.
You can have programs written fast, well, and cheap, but you only get to pick 2 ...

"I love deadlines. I like the whooshing sound they make as they fly by." Douglas Adams

User avatar
CirTap
Joomla! Explorer
Joomla! Explorer
Posts: 418
Joined: Mon Dec 12, 2005 5:34 pm

Re: Dev Wiki - Language question

Post by CirTap » Sun Jun 10, 2007 2:52 pm

there's also a little formatting error that looks a bit irritating:
Language file organisation
... Each language folder uses the language naming convention for its name. i.e. /languages/en-GB.Language files are ...

... Each language folder uses the language naming convention for its name. i.e. /languages/en-GB/. Language files are ...

Please someone add a trailing / and a space after the period.
You can have programs written fast, well, and cheap, but you only get to pick 2 ...

"I love deadlines. I like the whooshing sound they make as they fly by." Douglas Adams


Locked

Return to “docs.joomla.org - Feedback/Information”