Archives de catégorie : Japonais

Concernant la langue japonaise

Atom: police japonaise / Japanese font

(English below)

Dans l’éditeur de texte Atom, sous Kubuntu 15.04, les caractères japonais s’affichaient comme un carré (□), alors que les autres éditeurs (Emacs, Kate, Geany…) n’avaient pas ce problème. Pour obtenir un affichage correct, j’ai mis comme police dans les préférences «Oxygen Mono, TakaoPGothic». Par contre, comme avec les autres éditeurs de textes, les caractères japonais ne s’affichent pas avec une longueur fixe (vu que la police TakaoPGothic n’est pas une police à chasse fixe), mais ce n’est pas grave.

In the text editor Atom, in Kubuntu 15.04, the Japanese characters were displayed as a square (□), whereas the other editors (Emacs, Kate, Geany…) behave correctly. In order to obtain a correct display, I set in the settings the font as «Oxygen Mono, TakaoPGothic». However, as in the other editors, the japanese characters were not displayed with a fixed length (given that the font TakaoPGothic is proportional), but that’s not really a problem.

 

No porting Anki to Firefox OS

I thought about porting Anki/Ankidroid to Firefox OS, but I realized that I would be a daunting task (and not just a simple conversion from Python/Java to JavaScript). Why?

First reason: In Firefox OS, there is no native support for Sqlite, the library (and file format) used by Anki. There is a port of Sqlite done using emscripten (a C/C++ to Javascript converter), but it only operates on in-memory databases. So if you want to modify an existing Anki file, you need to load it completely in memory (mine is larger than 70Mo!), work on it, then save it completely in the end. So your modifications will not be saved after a transaction/card review, and working in memory may not fit with cheap phones.

Second reason: In Sqlite, there is an abstraction layer for I/O operations for each OS/family of OS. But it does not seem possible to create a implementation for Firefox OS… because the I/O in Firefox OS are asynchronous (when your read/write is done, it will call a callback function). And refactoring Sqlite in order to convert all the synchronous I/O calls to asynchronous calls seems an Herculean work.

What about IndexedDB? The data model of Anki is quite simple, but IndexedDB does not support joins, so it would have to be emulated with JavaScript code. Also, it will not help importing/exporting an existing Anki file…

Conclusion: From what I saw, I feel quite disappointed by the model adopted by Firefox OS, which only proposes a limited set of system API and seems quite limited for the port of existing libraries. Especially the asynchronous I/O aspect. It seems like this model is great for applications developed with Firefox OS in mind, but if you need to port an existing application… May it will get better (I hope there will be an official SQLite support)…

Firefox en japonais

Mise à jour: à partir de Firefox 59, cela se passe comme ça. La procédure ci-dessous concerne les versions antérieures à Firefox 59.

Pour avoir l’interface de Firefox en japonais, on peut bien sûr télécharger la version japonaise. Ou bien on peut installer un «pack de langue». Comme ceci:

  • Installer le pack de langue japonais, qui est une extension du navigateur.
  • Dans la barre d’adresse tapez « about:config » (la page des réglages avancés). Si vous avez une page de mise en garde, cliquez sur le bouton pour accepter les risques.
  • Recherchez le réglage « general.useragent.locale » et mettez la valeur «ja» (double-cliquez sur la ligne). C’est lui qui définit la langue de l’interface de Firefox.
  • Recherchez le réglage « intl.locale.matchOS » et mettez « false » (si elle est à « true » vous pouvez double-cliquer dessous pour la basculer à « false »). Sans ce réglage, Firefox va utiliser la langue de votre système d’exploitation / utilisateur (probablement le français), et pas celle définie ci-dessus.

Redémarrez votre navigateur. Préparez-vous à être un peu perdu.