[Sugar-devel] best way to localize audio and image files?

Bryan Berry bryan at olenepal.org
Thu Jul 16 08:28:00 EDT 2009


done!
http://wiki.sugarlabs.org/go/Development_Team/Sound#Crowdsourcing_Audio_and_Image_Localization
On Thu, 2009-07-16 at 14:16 +0200, David Schönstein wrote:
> Hi Byran,
> 
> Any chance of taking a couple of minutes to throw your question and
> proposed solution up on the Sugar Sound wiki?
> 
> http://wiki.sugarlabs.org/go/Development_Team/Sound
> 
> That way I can try ask around me and get some feedback from people
> from inside and outside the Sugar community.
> 
> Thanks a lot.
> 
> David
> 
> 2009/7/16 David Schönstein <dschonstein at arkamys.com>
>         Hi Byran,
>         
>         Any chance of taking 
>         
>         2009/7/16 Bryan Berry <bryan at olenepal.org>
>         
>         
>                 Sayamindu,
>                 
>                 I need your thoughts on the matter of localizing audio
>                 files and image
>                 files.
>                 
>                 I have two strategies in mind:
>                 
>                 1) Integrate w/ pootle
>                 2) Not integrated w/ pootle
>                 
>                 1) Integrate w/ pootle.
>                 
>                 When I grab the translatable strings from my files I
>                 also grab the
>                 filenames of the audio and image files and stick the
>                 value of the src=""
>                 attribute into in the .po as the msgid
>                 for example:
>                 
>                 >> index.html
>                 
>                 <img src="./images/house.png"> </img>
>                 
>                 <audio src="./sounds/yes.ogg"> </audio>
>                 
>                 >> karma.pot
>                 
>                 msgid "./images/house.png"
>                 msgstr ""
>                 
>                 msgid "./sounds/yes.ogg"
>                 msgstr ""
>                 
>                 >> ne-NP.po
>                 
>                 msgid "./images/house.png"
>                 msgstr "./images/ne-NP_house.png"
>                 
>                 msgid "./sounds/yes.ogg"
>                 msgstr "./sounds/ne-NP_yes.ogg"
>                 
>                 >> es-SP.po
>                 
>                 msgid "./images/house.png"
>                 msgstr "./images/es-SP_house.png"
>                 
>                 msgid "./sounds/yes.ogg"
>                 msgstr "./sounds/es-SP_yes.ogg"
>                 
>                 
>                 Then to load the localized strings, I simply use a
>                 jQuery CSS selector
>                 to write the translated strings into the markup at
>                 page load.
>                 
>                 the code is basically:
>                 
>                 var localeStrings = load('pofile_converted_to.json');
>                 
>                 for (var msgid in localeStrings){
>                        //if an element matches the msgid, replace it
>                 with the msgstr
>                        if (msgid.tagName === img or audio){
>                        $(:contains(msgid)).attr('src',
>                 localeStrings[msgid]);
>                        }
>                        else {
>                 
>                  $(:contains(msgid)).html(localeStrings[msgid]);
>                        }
>                  }
>                 
>                 Using the .po file for everything that can be
>                 localized makes everything
>                 nice and consistent
>                 
>                 That said, the whole point of putting stuff in .po
>                 files is that u can
>                 input the translated value directly into the .po with
>                 a text editor or
>                 the pootle interface. Going to all this trouble when
>                 pootle doesn't let
>                 u upload audio and image files seems a bit of a waste.
>                 
>                 
>                 2) Orrr, I could just check for images and sounds that
>                 are prefixed w/
>                 the current locale at run-time and load them.
>                 
>                 The problem with this it doesn't give us any
>                 forward-compatibility if we
>                 get pootle or find another solution to support
>                 crowd-sourcing
>                 translation of audio and image assets.
>                 
>                 Your thoughts are most appreciated.
>                 
>                 --
>                 Bryan W. Berry
>                 Technology Director
>                 OLE Nepal, http://www.olenepal.org
>                 
>                 _______________________________________________
>                 Sugar-devel mailing list
>                 Sugar-devel at lists.sugarlabs.org
>                 http://lists.sugarlabs.org/listinfo/sugar-devel
>         
>         
>         
>         -- 
>         
>         "The intuitive mind is a sacred gift and the rational mind is
>         a faithful servant.
>         We have created a society that honours the servant and has
>         forgotten the gift." Albert Einstein
>         
>         ================
>         David Schönstein
>         Arkamys
>         LIMSI-CNRS Thésard CIFRE
>         Groupe Audio Acoustique
>         Portable (Mobile Phone): +33 (0)6 88 49 95 75
>         www.listenwithyourownears.com
>         www.arkamys.com
>         www.limsi.fr
>         ================
> 
> 
> 
> -- 
> 
> "The intuitive mind is a sacred gift and the rational mind is a
> faithful servant.
> We have created a society that honours the servant and has forgotten
> the gift." Albert Einstein
> 
> ================
> David Schönstein
> Arkamys
> LIMSI-CNRS Thésard CIFRE
> Groupe Audio Acoustique
> Portable (Mobile Phone): +33 (0)6 88 49 95 75
> www.listenwithyourownears.com
> www.arkamys.com
> www.limsi.fr
> ================
-- 
Bryan W. Berry
Technology Director
OLE Nepal, http://www.olenepal.org



More information about the Sugar-devel mailing list