Language
[ class tree: Language ] [ index: Language ] [ all elements ]

Class: I18N_Messages_Translate

Source Location: /I18N-1.0.0/Messages/Translate.php

Class Overview

Tree_OptionsDB
   |
   --I18N_Messages_Translate

Description


Author(s):

Version:

  • 2001/12/29

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 33]
Description


[ Top ]


Class Variables

$options = array(   'tablePrefix' =>    'translate_'    // the DB-table name prefix, at the end we add the lang-string passed to the method
                            ,'sourceLanguage'=>  'en'           // the source language, the language used to retrieve the strings to translate from
                                                                // its also the table which is used to retreive the source string
                            
                            // be case senstivie by default since not all languages write nouns and verbs etc. 
                            // in lower case translating from german might fail if the case is not considered
                            ,'caseSensitive'=> true

                            ,'translatorUrl' =>  ''              // the url to a translator tool, only used if given
                         )

[line 36]


Type:   mixed


[ Top ]

$possibleMarkUpDelimiters =

[line 61]

Those are the delimiters surrounding translatable text.

This way we prevent from translating each HTML-tag, which definetly wouldnt work :-) those delimiters might also work on any other markup language, like xml - but not tested

NOTE: if you have php inside such a tag then you have to use an extra filter since <a href="">< ?=$var? ></a> would find the php-tags and see them as delimiters which results in < ?=$var? > can not be translated, see sf.net/projects/simpletpl, there is a filter in 'SimpleTemplate/Filter/Basic::applyTranslateFunction' which solves this it wraps a given function/method around it so that it finally will be: <a href="">< ?=translateThis($var)? ></a>


Type:   array


[ Top ]



Method Detail

I18N_Messages_Translate (Constructor)   [line 135]

I18N_Messages_Translate I18N_Messages_Translate( $dsn, [ $options = array()])

for pre-ZE2 compatibility
  • Author:
  • Version:
  • Access: public

Parameters:

   $dsn   — 
   $options   — 

[ Top ]

__construct (Constructor)   [line 119]

I18N_Messages_Translate __construct( $dsn, $options)

  • Author:
  • Version:
  • Access: public

Parameters:

   $dsn   — 
   $options   — 

[ Top ]

getAll   [line 232]

array getAll( string $lang)

returns the DB content for the source and the destination language given as paramter $lang

Parameters:

string   $lang   —  iso-string for the destination language

[ Top ]

simpleTranslate   [line 150]

string simpleTranslate( string $string, string $lang)

tries to translate a given string, but only exactly the string as it is in the DB
  • Return: the translated string
  • Author: Wolfram Kriesing <wolfram@kriesing.de>
  • Version: 01/12/29
  • Access: public

Parameters:

string   $string   —  the string that shall be translated
string   $lang   —  iso-string for the destination language

[ Top ]

translate   [line 197]

string translate( string $string, string $lang)

tries to translate a given string, it also tries using the regexp's which might be in the DB
  • Return: the translated string
  • Author: Wolfram Kriesing <wolfram@kriesing.de>
  • Version: 01/12/29
  • Access: public

Parameters:

string   $string   —  the string that shall be translated
string   $lang   —  iso-string for the destination language

[ Top ]

translateMarkUpString   [line 285]

string translateMarkUpString( string $input, string $lang)

translates all the strings that match any of the source language-string the input is mostly an HTML-file, and it is filtered so only real text is translated, at least i try it as good as i can :-)
  • Return: iso-string for the language
  • Author: Wolfram Kriesing <wolfram@kriesing.de>
  • Version: 02/01/08
  • Access: public

Parameters:

string   $input   —  the string that shall be translated, mostly an entire HTML-page
string   $lang   —  iso-string for the destination language

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:36:12 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.