Barebones CMS

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SSO in Spanish
#1
Hello,

I've just installed the SSO server and I'm looking for a language package in Spanish. DO you how can I get it ?

Thanks in advance for your answer
David
Reply
#2
Since it doesn't exist, you'll have to make it. If you are willing to do the translation work, I'm willing to work with you to create it.
Author of Barebones CMS

If you found my reply to be helpful, be sure to donate!
All funding goes toward future product development.
Reply
#3
Hello,

Of course, please, let me know next step how to create this language package.
Reply
#4
First, figure out the IANA language code (and region) you are targeting. The official list is here:

http://www.iana.org/assignments/language...g-registry

Then, calculate a string like 'es_mx' or 'es_es' (lowercase 'langcode_region'). Now create a directory called 'lang' inside of the SSO server directory. Then create a directory using the calculated language code string inside of 'lang'. Now, create a file called 'index.php'. So, the path and file should look something like 'lang/es_mx/index.php'.

The next step is to write the translation file. Translation files look like:

PHP Code:
<?php
    $bb_langmap
["es_mx"] = array(
        
"Unable to connect to the database." => "...UTF8 translated string goes here...",
        
"SSL expected.  Most likely cause:  Bad server configuration." => "...UTF8 translated string goes here...",
...
    );
?>

Anything ultimately handled by BB_Translate() and BB_PostTranslate() can be translated (most strings). The bulk of the work is index.php, admin.php, support/sso_functions.php, and the PHP files in the 'providers' directory. The rest of the stuff is minor except for the installer, which can't be translated.

Repeat the process for the SSO client. There's a lot less to translate and the SSO server endpoint messages are the bulk of the effort there.

Thanks for helping out! If you have any issues or suggestions, just let me know.
Author of Barebones CMS

If you found my reply to be helpful, be sure to donate!
All funding goes toward future product development.
Reply
#5
I did as your guide, thruska. Translation works well in SSO server, but in SSO client, it doesn't.
I found that, in Client config, there is only a lang definition: SS_CLIENT_DEFAULT_LANG.
But in BB_Translate() function, you used variable: $bb_admin_lang and $bb_admin_def_lang

Would you tell me how to solve this issue?
Thank and look forward to your help.



(11-07-2012, 07:53 AM)thruska Wrote: First, figure out the IANA language code (and region) you are targeting. The official list is here:

http://www.iana.org/assignments/language...g-registry

Then, calculate a string like 'es_mx' or 'es_es' (lowercase 'langcode_region'). Now create a directory called 'lang' inside of the SSO server directory. Then create a directory using the calculated language code string inside of 'lang'. Now, create a file called 'index.php'. So, the path and file should look something like 'lang/es_mx/index.php'.

The next step is to write the translation file. Translation files look like:

PHP Code:
<?php
    $bb_langmap
["es_mx"] = array(
        
"Unable to connect to the database." => "...UTF8 translated string goes here...",
        
"SSL expected.  Most likely cause:  Bad server configuration." => "...UTF8 translated string goes here...",
...
    );
?>

Anything ultimately handled by BB_Translate() and BB_PostTranslate() can be translated (most strings). The bulk of the work is index.php, admin.php, support/sso_functions.php, and the PHP files in the 'providers' directory. The rest of the stuff is minor except for the installer, which can't be translated.

Repeat the process for the SSO client. There's a lot less to translate and the SSO server endpoint messages are the bulk of the effort there.

Thanks for helping out! If you have any issues or suggestions, just let me know.
Reply
#6
I debugged, change bb_ to sso_ in function and index.php (translation lang file)
Reply
#7
Glad to hear you got it working.

The SSO client strings should be pretty rare to see in the first place - generally, fatal error messages.
Author of Barebones CMS

If you found my reply to be helpful, be sure to donate!
All funding goes toward future product development.
Reply
#8
Is there a simple way to translate basic text like "You must login to use this system",  "Select Sign In Method" or "Generic login" without delving into the system details? I am puzzled because I cannot find these strings anywhere in the code or the database. I just wanted to translate 5 phrases or so.

If anyone has setup the translation configuration as explained by thruska here, would it be possible to download the files so I understand better what I am supposed to do?

Sorry for such a silly question, I am not a good programmer but this SSO makes me feel actually dumb... I installed and set it up (except for the Facebook provider, that did not work) but can hardly understand the documentation and discussions in the forum.

Thank you for your understanding.
Reply
#9
Display strings are not stored in the database.

Create a directory tree off your main SSO server directory called "lang" and a subdirectory in that directory called "default". Inside that directory, create a file called "index.php". You should end up with "lang/default/index.php". Edit the newly created file. Translate strings by mapping what is displayed in English to what you want it to display by default. Something like:

PHP Code:
<?php
    $bb_langmap
[""] = array(
        
"You must login to use this system" => "...UTF-8 translated string goes here...",
        
"Select Sign In Method" => "...UTF-8 translated string goes here...",
...
    );
?>

Should get you started.

BB_Translate() is the primary translation function, which is used everywhere. So if you see a string displayed somewhere, it can probably be translated. You can also find every string that might need translating by searching for "BB_Translate".

The SSO server/client software is a large software product written by a crazy person (me). You shouldn't feel dumb. However, I can certainly see how someone might be overwhelmed if they crack open the source code.

The Facebook provider might actually be broken if you used the official software release of the SSO server. You could grab the updated version of the Facebook provider from over on GitHub and try again.
Author of Barebones CMS

If you found my reply to be helpful, be sure to donate!
All funding goes toward future product development.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)