[owncloud-devel] OC8 alpha 2 translation in app

Vincent Petry pvince81 at owncloud.com
Thu Jan 15 10:44:18 GMT 2015


Hi Patrick,

The current situation is transitional.

Ultimately there will only be a JSON file that can be asynchronously
loaded by the JS code explicitly.

The problem is that many apps' JS code isn't suited/designed in a way
that supports loading the translations asynchronously. This means apps
would need to defer their loading until after the callback/promise of
the translation loading is called.

Many core apps have this issue and will need to be adapted over time.

So the workaround is to provide an additional file "de.js" that can be
included as script tag to preload the translations before body onload or
"$(document).ready()" is called. Most apps startup code is designed to
run there so this will guarantee that the translations are already
loaded when they need it.
Note that it is not possible to load JSON files using a "script" tag.

Hope this helps. A bit complicated I know :-D

Cheers,

Vincent

On 01/15/2015 11:39 AM, Hoffmann, Patrick wrote:
> Hi,
> 
> my bad omg. Can you quick explain when the json file will be used?
> I assume the js will be used for scripts. Will they be needed in the future.
> But on the first look everything seems to work :-)
> 
> Cheers
> 
> Patrick
> 
> 
> 
> BITO-Lagertechnik Bittmann GmbH
> 
> Obertor 29
> 55590 Meisenheim
> Germany
> 
> Tel: +49 (0) 6753 122 0
> Fax: +49 (0) 6753 122 399
> 
> E-Mail: info at bito.de
> http://www.bito.de
> 
> Geschäftsführer: Werner Magin, Winfried Schmuck | HRB 2704 Bad Kreuznach | Gesellschafter: Fritz Bittmann Holding GmbH | USt-ID: DE 811 202 181
> 
> 
> *************************************************************************************
> Dieses E-Mail ist nur für den Empfänger bestimmt, an den es gerichtet ist und kann vertrauliches bzw. unter das Berufsgeheimnis fallendes Material enthalten. Jegliche darin enthaltene Ansicht oder Meinungsäußerung ist die des Autors und stellt nicht notwendigerweise die Ansicht oder Meinung von BITO-Lagertechnik Bittmann GmbH dar. Sind Sie nicht der Empfänger und haben diese E-Mail irrtümlich erhalten, sind jegliche Verwendung, Veröffentlichung, Weiterleitung, Abschrift oder jeglicher Druck dieser E-Mail strengstens untersagt. Jede ausgehende E-Mail wird von uns mit höchster Sorgfalt auf Viren geprüft. Jedoch übernehmen weder BITO-Lagertechnik Bittmann GmbH noch der Absender (Patrick Hoffmann) die Haftung für Viren; es obliegt Ihrer Verantwortung, die E-Mail und deren Anhänge auf Viren zu prüfen.
> 
> This email is exclusively meant for the addressee and may contain confidential information or information which can be classified as professional secret. Any view or opinion stated in this email is that of the author and does not necessarily represent the view or the opinion of BITO-Lagertechnik Bittmann GmbH. If you are not the addressee and if this email has been transmitted to you by mistake, you may not make use of, publish, transmit, reproduce or print the information contained therein for whatever purpose. We take every reasonable care to check all out-bound emails for viruses. However, neither BITO-Lagertechnik Bittmann GmbH nor the sender (Patrick Hoffmann) can be held liable for the occurrence of viruses and any consequential damages. It is therefore the addressee's sole responsibility to check incoming emails and attachments for viruses.
> *************************************************************************************
> Anhänge:
> Versand am 15.01.2015 11:39 von Patrick Hoffmann
> 
> -----Ursprüngliche Nachricht-----
> Von: devel-bounces at owncloud.org [mailto:devel-bounces at owncloud.org] Im Auftrag von Vincent Petry
> Gesendet: Donnerstag, 15. Januar 2015 11:29
> An: List for Developers of ownCloud
> Betreff: Re: [owncloud-devel] OC8 alpha 2 translation in app
> 
> Hi,
> 
> Your files de.js and de.json have syntax errors.
> 
> Replace "=>" with ":" and also remove the last trailing comma of the last entry. Unlike PHP, Javascript/JSON do not support having a comma after the last entry ("by":"von")
> 
> Cheers,
> 
> Vincent
> 
> 
> 
> _______________________________________________
> Devel mailing list
> Devel at owncloud.org
> http://mailman.owncloud.org/mailman/listinfo/devel
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.owncloud.org/pipermail/devel/attachments/20150115/d74ada82/attachment.sig>


More information about the Devel mailing list