Sync Pjirc language with user language

cesareaugusto - October 21, 2009 - 10:25
Project:PJIRC
Version:HEAD
Component:Code
Category:feature request
Priority:normal
Assigned:ruharen
Status:needs review
Description

At presente the PJIRC sets English as the default idiom. Would it be possible to make the module read which is the site language and set the same language for the PJIRC applet? It would be greatly useful for multi-language sites. Eg. If my user chooses the Italian version of my website the PJIRC module should automatically use the Italian language file for PJIRC. If the user chooses the English version, PJIRC should load in English, and so on.

#1

ruharen - October 21, 2009 - 20:21
Status:needs work» active

This would be a very interesting feature. I will investigate how this could be possible, but first i'm working on the "nick pre-selection" feature.

PS: 'needs work' status applies when an issue has a patch that has to be reworked or fixed. For now leave this as active ;)

#2

ruharen - October 21, 2009 - 20:32
Title:Language coherence» Sync Pjirc language with user language

Change title to a more descriptive one

#3

cesareaugusto - October 22, 2009 - 15:00

Great! If you need help in testing and translating the module into Italian just ask! I hope to be of any help!

#4

ruharen - October 22, 2009 - 20:17

In the next release there will be a translation template so everybody can start translating the module. I'll be happy if you contribute with italian translation. Thanks

#5

ruharen - November 2, 2009 - 19:27
Assigned to:Anonymous» ruharen
Status:active» needs review

I've been investigating this and it should be easy to implement, but there is a problem: the only way to change the language in PJIRC is to change the language filename for it. Sadly this filename (as it appears on pjirc.com webpage downloads) doesn't fit with any language name specification, and also don't fit with languages names in Drupal, so is not possible to link PJIRc filenames for language files with Drupal language at the moment.

My solution will be to ask users to manually change language filename to a name wich fits with Drupal's codename.
E.g.: italiano.lng to it.lng
espanol.lng to es.lng
english.lng to en.lng

Let me know of other suggestions. I have proposed this beacause I think is the easiest one.

#6

cesareaugusto - November 3, 2009 - 11:45

Another solution could be to code an interface with displays a roster of all the languages enabled in the Drupal site and, for every language enabled, a file uploader which lets the administrator upload only .lng files. The system then associates a custom .lng (no need to standardize the way it's named) to every Drupal language.

When the user logins, the module read his/her language, checks which is the PJIRC language file the admin associated to that idiom, and gives this vatiable to the Pixx Language Parameter

<param name="pixx:language" value="put-the-stored-language-file-here">

Would it work this way?

#7

ruharen - November 4, 2009 - 09:33

I've thought of that way of implementing it or anything similar and I think is the best way to implement it as it gives maximum flexibility and user-friendliness, but I thought I could leave things simpler this time as this is complicated to implement and involves file uploads within Drupal... Well, I'll try something ^_^

#8

ruharen - November 4, 2009 - 13:02

This is somewhat related to #623134: Add configuration to change background image of PJIRC as it has to deal with uploaded files. Some of the ideas apply here too:
Language files should not be updated to module's folder to prevent deletion/overwriting on updates or upgrades.

I consider files/pjirc/languages as a good folder to store uploaded language files.

 
 

Drupal is a registered trademark of Dries Buytaert.