TWiki
>
TWiki/ Web
>
TWikiI18NDotPm
(22 Jan 2008,
TWikiContributor
)
(raw view)
E
dit
A
ttach
---+ Package =TWiki::I18N= Support for strings translation and language detection. %TOC% ---++ ClassMethod *available_languages* <tt></tt> Lists languages tags for languages available at TWiki installation. Returns a list containing the tags of the available languages. __Note__: the languages available to users are determined in the =configure= interface. ---++ ClassMethod *new* <tt>($session)</tt> Constructor. Gets the language object corresponding to the current users language. If $session is not a TWiki object reference, just calls Local::Maketext::new (the superclass constructor) ---++ ObjectMethod *finish* <tt>()</tt> Break circular references. ---++ ObjectMethod *maketext* <tt>($text) -> $translation</tt> Translates the given string (assumed to be written in English) into the current language, as detected in the constructor, and converts it into the site charset. Wraps around Locale::Maketext's maketext method, adding charset conversion and checking Return value: translated string, or the argument itself if no translation is found for thet argument. ---++ ObjectMethod *language* <tt>() -> $language_tag</tt> Indicates the language tag of the current user's language, as detected from the information sent by the browser. Returns the empty string if the language could not be determined. ---++ ObjectMethod *enabled_languages* <tt>() -> %languages</tt> Returns an array with language tags as keys and language (native) names as values, for all the languages enabled in this TWiki.TWikiSite. Useful for listing available languages to the user. ---++ ObjectMethod *fromSiteCharSet* <tt>($text) -> $encoded</tt> This method receives =$text=, assumed to be encoded in {Site}{CharSet}, and converts it to a internal representation. Currently this representation will be a UTF-8 string, but this may change in the future. This way, you can't assume any property on the returned value, and should only use the returned value of this function as input to toSiteCharSet. If you change the returnd value, either by removing, updating or appending characters, be sure to touch only ASCII characters (i.e., characters that have ord() less than 128). ---++ ObjectMethod *toSiteCharSet* <tt>($encoded) -> $text</tt> This method receives a string, assumed to be encoded in TWiki's internal string representation (as generated by the fromSiteCharSet method, and converts it into {Site}{CharSet}. When converting into {Site}{CharSet}, characters that are not present at that charset are represented as HTML numerical character entities (NCR's), in the format <code>&#NNNN;</code>, where NNNN is the character's Unicode codepoint. See also: the =fromSiteCharSet= method.
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r2
<
r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r2 - 22 Jan 2008 - 00:21:27 -
TWikiContributor
TWiki/
Log In
or
Register
TWiki/ Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
User Reference
ATasteOfTWiki
TextFormattingRules
TWikiVariables
FormattedSearch
QuerySearch
TWikiDocGraphics
TWikiSkinBrowser
InstalledPlugins
Admin Maintenance
Reference Manual
AdminToolsCategory
InterWikis
ManagingWebs
TWikiSiteTools
TWikiPreferences
WebPreferences
Categories
Admin Documentation
Admin Tools
Developer Doc
User Documentation
User Tools
Webs
Abacos
Acbahia
AnpedGT16
ArcoDigital
Argumento
Avsan
CalculoB
Ceb
Cetad
CetadObserva
Cibercultura
Ciberfem
CiberParque
ColoquioCiags
Coloquiofasa
ConexoesSaberes
Cpdteste
Cppd
Creche
Cridi
Da
DACN
DCE
DelzaTeste
DeniseCarla
DepHistoria
DicionarioBelasartes
Ecologia
EDC
Educandow
EduMus
EleicoesReitor2010
Encima
Enearte
Estruturas
EstruturasEng
FACED
FAT
FepFaced
GEC
GeneticaBiodiversidade
GeneticaBiodiversidade3
GeneticaBiodiversidade
Gepindi
GetecEng
Godofredofilho
GrupoAlgebra
ICI010
Informev
Ites
LabioComp
LEG
Lepeja
Letras
LivroLivreSalvador
Main
MaisUm
Mata07
Mefes
MefesCpd
MetaReciclagem
Neclif
NelsonPretto
Nuclear
Numcad
Nutricao
Observa
OrfaosdeRua
PauloCostaLima
PdI
PescandoLetras
PETFilosofia
Pgif
PGNUT
PortalPpga
PosCultura
Pospetroigeo
PPGAC
PPGE
PpggBio
Ppggenbio
Pretto
Proad
PROGESP
ProjetoLencois
Quimica
RadioFACED
RadioTeatro
RadioWeb
Riosymposium10
Ripe
Salasdoctai
Sat
Sedu
SemBio
SeminarioPibid
SimoneLucena
Sociologia
SSL
Tabuleiro
TabuleirosUfba
TCinema
TerritoriosDigitais
TWiki
Twikidea
UFBAIrece
UniversidadeNova
VizinhoEstrangeiro
XIISNHCT
Български
English
Español
日本語
Português
Copyright � by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback