• You are not logged in.

Multilang?

  • Started by lopar
  • 46 Replies
  • lopar
  • New Member
  • Reputation: 0
  • From: Ukraine
  • Registered: 28-07-2015
  • Posts: 1

Hi there.
Is there any way to translate forum to other languages? Lang files maybe?

Offline
  • 0
  • Chris98
  • Project Manager
  • Reputation: 51
  • From: England, United Kingdom
  • Registered: 15-04-2015
  • Posts: 512

Hi lopar, welcome to Panther smile

Yes - although there is no documentation on this at the moment, it is very possible to add different languages. We actually plan to add as many languages in the core as possible. Here are the steps in creating a new language:

  1. In the 'lang' folder, create a new sub directory with the language name you wish (in English). Example, French or German.

  2. Now, copy all the files from the 'English' folder into the new folder you created.

  3. Finally, open the files in a text editor, and you will find an array, with strings in like below:

    'No plugins' => 'You must select at least one plugin to remove.', 

    Note: This was taken from lang/English/admin_addons.php

  4. Translate the string on the right.

  5. Save the file, and you should be able to select this from the admin options page, and in your profile.

Let me know if you'd like further assistance. I will be more than happy to help. smile

Kind regards,
Christopher Marshall
chris [at] get-aura [dot] org

Project Manager

Offline
  • 1
  • cyberman
  • Member
  • Reputation: 17
  • From: Federal Republic of Germany
  • Registered: 07-07-2015
  • Posts: 167

Can I use translations from FluxBB?

Universe is corrupt. Reboot: Y/N?

Offline
  • 0
  • Chris98
  • Project Manager
  • Reputation: 51
  • From: England, United Kingdom
  • Registered: 15-04-2015
  • Posts: 512

Yes - although some may very well be missing language indexes, and there are files that need to be added which weren't available in FluxBB. Let me know if you have any problems.

Kind regards,
Christopher Marshall
chris [at] get-aura [dot] org

Project Manager

Offline
  • 0
  • cyberman
  • Member
  • Reputation: 17
  • From: Federal Republic of Germany
  • Registered: 07-07-2015
  • Posts: 167

First and simple language file import. Got this

Errno [ 8 ]: Array to string conversion in /users/cybermax/www/panther/profile.php on line 1787

Universe is corrupt. Reboot: Y/N?

Offline
  • 0
  • Chris98
  • Project Manager
  • Reputation: 51
  • From: England, United Kingdom
  • Registered: 15-04-2015
  • Posts: 512

Thanks. Looking into this now.

Kind regards,
Christopher Marshall
chris [at] get-aura [dot] org

Project Manager

Offline
  • 0
  • Chris98
  • Project Manager
  • Reputation: 51
  • From: England, United Kingdom
  • Registered: 15-04-2015
  • Posts: 512

What language pack did you import?

Kind regards,
Christopher Marshall
chris [at] get-aura [dot] org

Project Manager

Offline
  • 0
  • cyberman
  • Member
  • Reputation: 17
  • From: Federal Republic of Germany
  • Registered: 07-07-2015
  • Posts: 167

German

Universe is corrupt. Reboot: Y/N?

Offline
  • 0
  • cyberman
  • Member
  • Reputation: 17
  • From: Federal Republic of Germany
  • Registered: 07-07-2015
  • Posts: 167

Thx, works - now I got this


Errno [ 2 ]: require(/users/cybermax/www/panther/lang/German/warnings.php) [<a href='http://de.php.net/function.require'>function.require</a>]: failed to open stream: No such file or directory in /users/cybermax/www/panther/profile.php on line 1627

Ok, create an empty file warnings.php. Got this


Errno [ 8 ]: Undefined variable: lang_warnings in /users/cybermax/www/panther/profile.php on line 1641


I know it's now my job to create and fill warnings.php but I think a fallback to english would be good idea, better a double fallback.

If a special language file doesn't exist english should be loaded per default, if a special string isn't available (cause the lang file needs a rework) only this english string will be shown instead.


It's not professional to see an error message or nothing wink


In moment the only chance is to set the language completely back to english.

Universe is corrupt. Reboot: Y/N?

Offline
  • 0
  • Chris98
  • Project Manager
  • Reputation: 51
  • From: England, United Kingdom
  • Registered: 15-04-2015
  • Posts: 512

I completely understand what you're saying - however, generally, this should not happen because languages included by default in future versions will not have these errors. I think of it from more of a "developer" point of view; if you're developing a new language pack, you should really get these errors because it tells you where the problem is. If you just get an English language string, you'll have to traverse through the files to see where the problem is.

That said though, I do agree that we need an English language pack fall-back in case the default does not exist.

Kind regards,
Christopher Marshall
chris [at] get-aura [dot] org

Project Manager

Offline
  • 0
  • cyberman
  • Member
  • Reputation: 17
  • From: Federal Republic of Germany
  • Registered: 07-07-2015
  • Posts: 167

Yeah, it's really hard to "synchronize" all translators on open source projects big_smile.

I know I'm talking about - have worked for a lot of open source projects as translator ...

Or maybe there should a special developer / translator mode to see such errors?

  • Last edited by cyberman (06-09-2015 10:47:29)

Universe is corrupt. Reboot: Y/N?

Offline
  • 0
  • Chris98
  • Project Manager
  • Reputation: 51
  • From: England, United Kingdom
  • Registered: 15-04-2015
  • Posts: 512

That's not at all a bad idea.

There is currently an error suppression mode (i.e. deleting an avatar .etc in case it doesn't exist). Perhaps with a bit of enhancement, we could allow a constant to enable supressed errors being detected as normal errors.

Kind regards,
Christopher Marshall
chris [at] get-aura [dot] org

Project Manager

Offline
  • 0
  • cyberman
  • Member
  • Reputation: 17
  • From: Federal Republic of Germany
  • Registered: 07-07-2015
  • Posts: 167
Chris98 said:

 there are files that need to be added which weren't available in FluxBB. 

I'm trying to do that wink - and have seen it on my "translation console": Some of your lang files are ANSI encoded, and some files are in UTF8.

Not sure it this will make trouble on any place roll ...

  • Last edited by cyberman (09-09-2015 19:28:46)

Universe is corrupt. Reboot: Y/N?

Offline
  • 0
  • Chris98
  • Project Manager
  • Reputation: 51
  • From: England, United Kingdom
  • Registered: 15-04-2015
  • Posts: 512

Thank you, will take a look at this. They should all be UTF8.

Kind regards,
Christopher Marshall
chris [at] get-aura [dot] org

Project Manager

Offline
  • 0
  • Chris98
  • Project Manager
  • Reputation: 51
  • From: England, United Kingdom
  • Registered: 15-04-2015
  • Posts: 512

Can't find any language files from 1.0.8 with ANSI encoding. Was this a fresh install of 1.0.9 you tried?

Kind regards,
Christopher Marshall
chris [at] get-aura [dot] org

Project Manager

Offline
  • 0
  • cyberman
  • Member
  • Reputation: 17
  • From: Federal Republic of Germany
  • Registered: 07-07-2015
  • Posts: 167

No, was 1.0.8

Will check it again...

Universe is corrupt. Reboot: Y/N?

Offline
  • 0
  • cyberman
  • Member
  • Reputation: 17
  • From: Federal Republic of Germany
  • Registered: 07-07-2015
  • Posts: 167

Have located a lot of redundancies (I'm currently at admin_options.php) - for example


    'Too large ini' => 'The selected file was too large to upload. The server didn\'t allow the upload.',
    'Partial upload' => 'The uploaded file only partially uploaded. Please attempt to upload the file again.',
    'No tmp directory' => 'The server was unable to upload the file to a temporary directory.',
    'No file' => 'You did not select a file to be uploaded.',
    'Bad type' => 'You are not allowed to upload this type of file. Please upload an icon file (.ico).',
    'Options updated redirect' => 'Options updated. Redirecting …',
    'Options head' => 'Options',
    'Too large' => 'The file you tried to upload is larger than the maximum allowed %s bytes.',
    'Too wide or high' => 'The file you tried to upload is wider and/or higher than the maximum allowed %sx%s pixels.',

They are only examples. There are some more wink. And they are available in more than one lang file ... think they should be in /lang/common.php

Universe is corrupt. Reboot: Y/N?

Offline
  • 0
  • cyberman
  • Member
  • Reputation: 17
  • From: Federal Republic of Germany
  • Registered: 07-07-2015
  • Posts: 167

There are 47 lang files cool - AFTER translation most of them it's a little bit difficult to say where I've read the redundancies.

The posted snippet is for example inside admin_addons.php, admin_options.php and admin_smilies.php. 

But think there are some more ...

I know - performance rulez -  but sometimes I have the feeling core lang files should be grouped and reduced/merged. After alphabetical ordering it's a lot easier to find redundancies roll...

Universe is corrupt. Reboot: Y/N?

Offline
  • 0
  • Chris98
  • Project Manager
  • Reputation: 51
  • From: England, United Kingdom
  • Registered: 15-04-2015
  • Posts: 512

You're right - it's pointless having the same language strings in the different files.

I'm currently working on the template system and implementing Twig, so to make sure this is not forgotten can you add a ticket please?

Kind regards,
Christopher Marshall
chris [at] get-aura [dot] org

Project Manager

Offline
  • 0
  • cyberman
  • Member
  • Reputation: 17
  • From: Federal Republic of Germany
  • Registered: 07-07-2015
  • Posts: 167

Ahh, ok, Twig is your favourite big_smile ... maybe it could be merged by default with Twital

https://github.com/goetas/twital

Yes, will create a ticket ...

Universe is corrupt. Reboot: Y/N?

Offline
  • 0
  • Chris98
  • Project Manager
  • Reputation: 51
  • From: England, United Kingdom
  • Registered: 15-04-2015
  • Posts: 512

I'll see how this goes for the moment. I admit the syntax is much easier in Twital, but Twig is already ~900 KB in size, and without any plugins. My main concern is the file size.

Kind regards,
Christopher Marshall
chris [at] get-aura [dot] org

Project Manager

Offline
  • 0
  • cyberman
  • Member
  • Reputation: 17
  • From: Federal Republic of Germany
  • Registered: 07-07-2015
  • Posts: 167

Yeah - easier syntax was the reason for suggesting Twital wink.

And yes, Twig is a full size framework. 

That was the reason I suggest Fat Free (Micro) Framework in the past - has only 89 kB tongue. Maybe the better/best solution for a Fat Free Forum big_smile.

Universe is corrupt. Reboot: Y/N?

Offline
  • 0
  • cyberman
  • Member
  • Reputation: 17
  • From: Federal Republic of Germany
  • Registered: 07-07-2015
  • Posts: 167

As I said I'm on translating - a quote:

    'Show queries help' => 'This option will add query information to the bottom of every page. <strong>Note:</strong> This will display all the queries for that page to all users. It is strongly recommended this be turned off when finished debugging.',

But I'm seeing this information at the bottom tongue. Are you on debugging your site big_smile? Or have you forgotten your own recommendation cool?

Universe is corrupt. Reboot: Y/N?

Offline
  • 0

Users in this topic: 0 guests, 0 registered users