N Lize

50 %
50 %
Information about N Lize

Published on October 26, 2008

Author: artonx

Source: slideshare.net


Sapporo RubyKaigi 2008


Rubyの エラーメッセージを 多国語対応させる 拡張ライブラリ

LL Future



エラーメッセージ を読む人は 英語でも読む

読まない人は 日本語でも 読まない

日本語化 してみたら どうなるか?




tool/extmsg.rb ソースコードからメッセージを抽出

po/rubymsg.pot 抽出済みメッセージ

po/ja/rubymsg.po 翻訳済みメッセージ

lib/nlize.rb ローダ

ext/cnlize.so メッセージ置き換えエンジン というか、これを作ってみたかった

#if defined(_WIN32) VirtualProtect(org, 8, PAGE_EXECUTE_READWRITE, &old); #else ret = mprotect((void*)((int)org & PAGE_MASK), 8, PROT_READ | PROT_WRITE | PROT_EXEC); if (ret) { /* ignore nlize */ return; } #endif

コーディングモディフィケーション /* i386 only */ *org = '¥xff'; *(org + 1) = '¥x25'; memcpy(org + 2, &palt, 4);

誤算 irbでテストしていたので、 パーシング中のエラーを 置き換えられないことに 気づいていなかった。

i386に依存 テスト済み OS X for Intel Win32 LinuxはAmd64なので テストできなかった


$ gem sources -a http://gems.github.com $ sudo gem install arton-nlize

Win32Binary http://arton.no-ip.info/data/nlize/ C:¥temp¥nlize>gem install nlize Successfully installed gettext-1.93.0 Successfully installed nlize-0.0.2-x86-mswin32-60 2 gems installed Installing ri documentation for gettext-1.93.0... Installing RDoc documentation for gettext-1.93.0..

しかし Gemはお勧めしない

ruby -rubygems -e quot;require'nlize';howdy folks!quot; -e:1: folks!はmain:Objectの未定義メソッドです (NoMethodError) require ‘nlize’ #=> bad

setup.rbがお勧め (gettextは別途入手)

ruby -rnlize -e “howdy folks!quot; -e:1: folks!はmain:Objectの未定義メソッドです (NoMethodError) -rnlize #=> good !

#else presentations

Add a comment

Related presentations

Presentación que realice en el Evento Nacional de Gobierno Abierto, realizado los ...

In this presentation we will describe our experience developing with a highly dyna...

Presentation to the LITA Forum 7th November 2014 Albuquerque, NM

Un recorrido por los cambios que nos generará el wearabletech en el futuro

Um paralelo entre as novidades & mercado em Wearable Computing e Tecnologias Assis...

Microsoft finally joins the smartwatch and fitness tracker game by introducing the...

Related pages

nLite - Deployment Tool for the bootable Unattended ...

Ever since I released the nLite update after so many years, I am getting the same question: will there be nLite for Windows 7+, is current nLite update all ...
Read more

Lize N | LinkedIn

View Lize N’S professional profile on LinkedIn. LinkedIn is the world's largest business network, helping professionals like Lize N discover inside ...
Read more

kann man eigentlich auch ohne Paypal an Lize… | Forum ...

N; O; P; Q; R; S; T; U; V; W; X; Y; Z & 123; heise online; c't Magazin; iX Magazin; Technology Review; Mac & i; c't Fotografie; Telepolis; Make; heise ...
Read more

Lize Rbn | Facebook

Lize Rbn is on Facebook. Join Facebook to connect with Lize Rbn and others you may know. Facebook gives people the power to share and makes the world...
Read more

Bedeutung Vorname Lize

Hier finden Sie Informationen über die Bedeutung und Herkunft des Namens Lize. Ist Ihr Name Lize? Bitte beantworten Sie 5 Fragen über Ihren Namen um ...
Read more

LIZE - Facebook

Saturday, September 13, 2014 LIZE and GENGHIS KHAN. Old School Foggy Bottom night!! Royal Place 9:30pm 2660 Library Rd, Pittsburgh, PA 15234 (412) 882-8000
Read more

Lize - YouTube

Lize Beekman - Ek Het 'n Boer Sien Dans - Duration: 4:15. Brian Currin 35,245 views. 4:15 AS IGREJAS DE ANGOLA - Duration: 6:06. Marco ...
Read more

Lize _ on Pinterest

See what Lize _ (lizecrauwels) has discovered on Pinterest, the world's biggest collection of everybody's favorite things.
Read more

Lizzo² | Flickr - Photo Sharing!

Explore Lizzo²'s 2 photos on Flickr! ... Save Cancel. Drag to set position! Lizzo²
Read more

Suchergebnis auf Amazon.de für: Magvay & Novskyy feat ...

Online-Shopping mit großer Auswahl im Musik-Downloads Shop.
Read more