[luci] adding text/translation for new configuration option

Jo-Philipp Wich xm at subsignal.org
Sat Jul 25 02:19:32 CEST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Henning.


There is a fast and a proper solution :)

The fast one is to make the human readable text the second argument of
the translate function:

  translate("some_not_existing_key", "The default text")


translate() will use the provided default text if the key is missing in
the i18n files.


In order to properly add the new string, you need to add it to the *.po
files of your languages.

Regenerating the lang files from within the sdk is easy, just run

  make i18nbuild  to regenerate all target files.

With the OpenWrt Buildroot, the following make command should do the trick:

  make package/feeds/yourfeedname/luci/{clean,compile}


Regards,
JoW
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkpqT5MACgkQdputYINPTPMDKACfTR9XYqd5M4EGzxCwDIKtgB4d
9NoAoIef3e2WZMefz1Ychtfw4KzUEjNZ
=3tbT
-----END PGP SIGNATURE-----


More information about the luci mailing list