HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Launchpad Help, FAQ and Support Thread

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#48157 (In Topic #10535)
Avatar

Fan in action

Ask here if you need any translation help!

I will upgrade the translation files this evening!

What is Launchpad?

Launchpad's intuitive web interface allows anyone who speaks English and another language as their mother tongue to help translate your project into their language, ready for export in standard GNU GetText files. Putting your project into Launchpad gives you access to 30,000 translators working in 257 languages, with automatic suggestions from a library of more than sixteen million strings.

Why are we using Launchpad for translations?

We are using Launchpad for translation, because has many advantages to use it:
  • You don't need any program anymore for translation. You can translate ocP from every computer with internet and browser in the hole wide world
  • Before we used launchpad for translation the changes were made local on the computer, not every one know how to translate these files! It is much easier now!
  • No double translation is made anymore! People can work together without having to be very organised. You can see which files are already translated and which ones not!
  • Instant sharing of progress.

How do I translate in Launchpad?

You just need to register here and set up your profile with your speaking language. Then visit this site, choose a translation template and beginn. It is really easy!

Questions by moimaim:

How can we flag some strings as DNT (do not translate)?

You dont need to flag them. Just left them blank, they will be automatically shown as not translated!

How do we append other files, like a zip of the graphic files?

We actually cant upload them to Launchpad, because launchpad can just work with language strings. How is it if we open a forum in here ? (Launchpad is originally written for open source software like Ubuntu or Openoffice not for website scripts)

What happens now 4.1.6 is out? (4.2 is coming soon).

We will update the language strings to the new version :-) The old ones which are not changed and which are already translated will be shown as translated in the new version, too. So no double work is need to do!

Couldn't find a screen with a general view of what has been done, and what is left, does this option exist?

There isn't a general view of all files, but there is a overview for each templatefile. You find it if you click on the template names.

On the few small ones I did, copied the french to the fields from a text file I already have. Longest one had 27 strings, that's still manageable. Also have most of the others, like ocf and global. How can this be included in Launchpad?

This is no problem :-) but you have to convert them to .po files tar.gz them and upload them at launchpad with a special directory structure. This is a little bit complicated.

If you would upload them here I'm going to do that for you.
If you want to do that by yourself, I will it explain for you, how you have to to it! :lol:

Are there others little helpers for translations in launchpad?

Yes,
Chris Graham
wrote a littel script
which uses google translator for translations in launchpad. He is his description:

Chris Graham said

Anybody familiar with the Firefox Greasemonkey addon?

I have just written a script for it that automatically Google translates all strings on the Launchpad translation screen you're on, and also provides a button (link near top) to paste in ocPortal .ini files.

It's working alright. Taken me a lot longer than I thought it would so I won't have time to maintain this, for now at least, but here's the code (you need to first install Greasemonkey then add a script - any namespace/description you like - and then put in this code when the blank file opens in your text editor):

Tip: You can add ?batch=100/&batch=100 to the end of a translation URL to make the translation screens longer. It's a shame you can't load them all as then the paste would work better.

This is the script:

Code

// ==UserScript==
// @name           .ini -> launchpad
// @namespace      http://ocportal.com
// ==/UserScript==

if (window.location.href.indexOf('translations.launchpad.net/ocportal')==-1) return;

// Load Google Translate
var link=document.createElement('script');
link.setAttribute('type',"text/javascript");
var url="http://www.google.com/jsapi?callback=doneLoadingJSAPI";
link.setAttribute('src',url);
document.getElementsByTagName('head')[0].appendChild(link);

unsafeWindow.doneLoadingJSAPI = function() { unsafeWindow.google.load('language','1', {"callback" : google_translate_all}); }

function google_translate_all()
{
   var labels=document.getElementsByTagName('label');
   for (var i=0;i<labels.length;i++)
   {
      if (labels[i].className=='no-translation')
      {
         test_match=labels[i].id.match(/^msgset\_(\d+)\_(\w+)\_translation\_0$/);

         if (test_match[0])
         {
            google_translate(test_match[1],test_match[2]);
         }
      }
   }
}
function google_translate(id,page_language)
{
   with (unsafeWindow)
   {
      var before = document.getElementById('msgset_'+id+'_singular');
      var text = html_entity_decode(before.innerHTML).replace(/<br \/>/g,"\n").replace(/\{/g,'(((').replace(/}/g,')))');
      var translated = document.getElementById('msgset_'+id+'_'+page_language+'_translation_0_new');
      if (translated.value!='') return;

      unsafeWindow.google.language.translate(text, "en", page_language,
         function(result) {
            if (result.translation)
            {
               result.translation = result.translation.replace(/\(\(\(/g,'{').replace(/\)\)\)/g,'}').replace(//g,'\'').replace(//g,'\'');
               translated.value = html_entity_decode(result.translation);
               document.getElementById('msgset_'+id+'_'+page_language+'_translation_0_new_select').checked=true;
            }
         });
   }
}

function html_entity_decode(str)
{
    //jd-tech.net
    var  tarea=document.createElement('textarea');
    tarea.innerHTML = str; return tarea.value;
    tarea.parentNode.removeChild(tarea);
}


// Now put a .ini file translation button up

var ocp_link=document.createElement('a');
ocp_link.innerHTML='.ini convert';
ocp_link.style.background='#FAA';
ocp_link.style.border='#D88';
ocp_link.style.position='absolute';
ocp_link.style.right='400px';
ocp_link.style.top='10px';
ocp_link.style.display='block';
ocp_link.href="Javascript: void(document.getElementById('ocp_lang').style.display='block');";
var form=document.createElement('form');
form.style.background='#FAA';
form.style.border='#D88';
form.style.position='absolute';
form.style.left='100px';
form.style.top='100px';
form.style.display='none';
form.id='ocp_lang';
// e.g. BLOCK_main_cc_embed_DESCRIPTION=test
form.innerHTML=
'<textarea style="display: none" name="codefiddle">\n'+
'      var split=window.initext.split(/\\n/);      \n'+
'      var classes=document.getElementsByClassName("discreet");      \n'+
'      for (var i=0;i&lt;split.length;i++)      \n'+
'      {      \n'+
'         var parts=split[i].split("=",2);      \n'+
'         if (parts.length==2)      \n'+
'         {      \n'+
'            for (var j=0;j&lt;classes.length;j++)   \n'+
'            {   \n'+
'               if (classes[j].cells[1].innerHTML.indexOf("[strings]"+parts[0])!=-1)\n'+
'               {   \n'+
'                  var input=classes[j].previousSibling.previousSibling.previousSibling.previousSibling.getElementsByTagName("input");\n'+
'                  if (input[1]) { input[0].checked=true; input[1].value=parts[1]; }  \n'+
'               }   \n'+
'            }   \n'+
'         }      \n'+
'      }      \n'+
'</textarea>'+
'<textarea name="ini" cols="80" rows="29">PASTE INI FILE CONTENTS IN HERE</textarea><br /><input type="button" value="Use" onclick="window.initext=this.form.elements[\'ini\'].value; eval(this.form.elements[\'codefiddle\'].value); this.form.style.display=\'none\';" />';
document.body.appendChild(form);
document.body.appendChild(ocp_link);

How can I get the .po files back into ocPortal?

LaunchPad provides a link to download all the files. From ocPortal 4.1.11 onwards you'll be able to just copy the files into lang_custom/<langcode>/ (make that folder) and they'll work out of the box.
For this to work in 4.1.9 and 4.1.10 upload the attached files:
Attachment
sources/lang.php
» Download: lang.php (43 Kb, 189 downloads so far)

Attachment
sources/lang2.php
» Download: lang2.php (7 Kb, 187 downloads so far)


Can I ask other questions?

Yes, sure. Just ask them here. I will try to help you!


Last edit: by Chris Graham

Wanna help to translate ocP in your own language? Then take a look to this site! Please register here before!
Any problems, or questions?
Look here!
Back to the top
 
Posted
Rating:
#48187
Avatar

Fan in action

Launchpad NEWS

Launchpad News

2009-02-06: Translation updated to V 4.1.6
Hi, i just updated the language strings to ocPortal Version 4.1.6. The files will be avalible soon when there are reviewed by an launchpad administrator!

Wanna help to translate ocP in your own language? Then take a look to this site! Please register here before!
Any problems, or questions?
Look here!
Back to the top
 
Posted
Rating:
#48252
Avatar

Thanks for organizing all this, sunlightshadow :)

Back to the top
 
Posted
Rating:
#48280
Avatar

Fan in action

 

:thumbs: My opinion is that a software it really open source when it is avalible in other languaches. Not everyone can enjoy ocP, because there a masses of peopel out there who can't talk english, which means that is not avalible to them.
I want to make it better. :-)

Otherwise I think it will be a great step for ocp too. When the first langs are avalible because I think ocp becames more famous then. Nobody really knows in germany about this great cms. This should be changed!!!

Wanna help to translate ocP in your own language? Then take a look to this site! Please register here before!
Any problems, or questions?
Look here!
Back to the top
 
Posted
Rating:
#48301
Avatar

Community saint

hehe you do the translations and I do the themes and we can make this thing great.

I run http://otakuplayground.com and am hopping to make themes and other things for ocportal even though I no longer use it for otakuplayground.com I still love it and feel it could go far with the right help. It needs themes and needs people to advertise for it.
Back to the top
 
Posted
Rating:
#48325
Avatar

Fan in action

hey amichan desgin queen of ocp :D

would you help me to do a theme?

Wanna help to translate ocP in your own language? Then take a look to this site! Please register here before!
Any problems, or questions?
Look here!
Back to the top
 
Posted
Rating:
#48342
Avatar

Community saint

Yes I can help you do a theme or at least I can try.
Let me know what you want it to look like.

I run http://otakuplayground.com and am hopping to make themes and other things for ocportal even though I no longer use it for otakuplayground.com I still love it and feel it could go far with the right help. It needs themes and needs people to advertise for it.
Back to the top
 
Posted
Rating:
#48347
Avatar

Fan in action

i will tell you in a private topic

Wanna help to translate ocP in your own language? Then take a look to this site! Please register here before!
Any problems, or questions?
Look here!
Back to the top
 
Posted
Rating:
#49652
Igr
Avatar

Well-settled

Hi,

I have made some translations on launchpad and download some files. After converting .po files to .ini all Lithuanian letters were changed by strange symbols. I'm not professional on this, so maybe someone have advises how to solve this problem.

3. Also I wanted to translate on my ocPortal and then import into launchpad, but when I tried to convert .ini to .po I received this message:
ini2po: warning: Error processing: input bookmarks.ini, output bookmarks.po, template None: 'utf8' codec can't decode bytes in position 8-9: invalid data
The problem occurs when .ini file contains Lithuanian letters.

For both conversations I have used ini2po and po2ini conversation tools.

Mybe there are some others converters?

ocPortal 4.1.13
PHP 5.2.6-2 unbutu 4.2
MySQL 5.0.67 unbutu 6
Apache 2.2.9 unbutu
Back to the top
 
Posted
Rating:
#51173
Avatar

Fan in training

Can anybody help?

Hello,

ive downloaded the complete translaitionpackage from launchpad (launchpad-export.zip) and the translation-toolkit for Windows from start Translate Toolkit & Pootle.

I copy all the .pot files from the subdirs in the extracted launchpad-export folder to

G:\launchpad\pot

and all *de.po from the self subdirs to

G:\launchpad\po

When i run the command

po2ini -t G:\launchpad\pot\ G:\launchpad\po\ G:\launchpad\ini\

comes the following errormessage:

po2ini: warning: Couldn't handle input file : don't know what to do with input format (no file extension), no template file

can anybody help me?? :$ :'( :$

thanks in advance
Audiator

PS: Sorry my bad english! :$
Back to the top
 
Posted
Rating:
#51265
Avatar

Good news! :)

I have updated Sunlightshadow's post above with some updated ocPortal files that will allow you to use the .po files directly within ocPortal without having to convert. We'll be including this from 4.1.11 onwards.
See:
"How can I get the .po files back into ocPortal?"


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#56077
Avatar

Fan in training

Having trouble getting .po files to work.  

Followed instructions and downloaded from Launchpad the Poll file [polls.pot_polls-es.po], uploaded it to the lang_custom/ES/ folder.

Nothing has changed.  The Polls are not in Spanish.

Are there any toggles or setting I need to change to make this work?

Started some manual translation of the site, but hoped the previously translated files from Launchpad would save us a lot of time.

The site is www.vidalatinos.com/vida

Any assistance would be appreciated.

Also, if anyone has a complete "Spanish Language Pack" with the .ini files, it would be great.

Brian
Back to the top
 
Posted
Rating:
#56078
Avatar

Hi,

I'm not sure how you got a file named that. What link did you click?

The way I've done it before is to just download everything, which you can do from:
https://translations.launchpad.net/ocportal/4.2.0/+export
and just extract all the .po files from there.
You don't need to rename, the only thing is you just make sure you extract them all to the same directory (the archive it generates has lots of subdirectories instead).


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#56079
Avatar

Fan in training

Thanks Chris.

I downloaded that file from https://translations.launchpad.net/ocportal/4.2.0/+pots/polls/es/+translate and clicked on "Download translation".

I will do as you suggested.

Do I upload them to the lang_custom/ES/ folder?

Or the lang/ES folder?

Or the lang_cached/ES folder?

Brian


Back to the top
 
Posted
Rating:
#56080
Avatar

lang_custom/ES/


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#56081
Avatar

Fan in training

Hi Chris,

Got the .po files down loaded, sorted out all the -es.po and .pot files, and uploaded them using ftp to the lang_custom/ES/ directory.

The site is still not in Spanish.

When I run "Criticise language pack" on Spanish I get "Translation Fault" on all the files.

Any ideas?

Thanks,

Brian
Back to the top
 
Posted
Rating:
#56082
Avatar

Did you turn on Spanish in the install options, or via your member profile?


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#56083
Avatar

Fan in training

I don't think so.

I have spent the last hour trying to find where you "turn on Spanish".  

I see it referenced in the tutorial, but I don't see any directions on how to get to it.  I also see in another post that you recommend editing the config_editor.php file to change the language, but I cannot find the correct string to change in that file.

Tried all of the options under AdminZone Style, Setup, and Tools.  But can not find this setting.

Please direct me how to "turn on Spanish"

Thank you.
Back to the top
 
Posted
Rating:
#56092
Avatar

You'll need to run (open in your browser) config_editor.php rather than editing it.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#56093
Avatar

Adding this to the documentation…

Turning on a different language

To change the language used on your site, use the http://yourbaseurl/config_editor.php script (load up the URL, with yourbaseurl substituted with your real base URL).

Alternatively members can select their language by editing their member profile. This may also be necessary because they might already have their profile locked down to English.

To test you can also append &keep_lang=FR to the URL (this is an example for French). If the URL did not contain an "?" symbol already you would need to append ?keep_lang=FR instead.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Expand