I am sorry for the last 2 points (3 & 4) that was due to my mistake ..
Point 3 (Problem in Encoding format) : This was due to my header file which
i was using. The file was having charset iso-8859-1 in the meta tag. I have
replaced that with UTF-8 and now it is working fine :)
Point 4 (paragraph translation) : I think that was due to some line feed
characters, I have removed the "ENTER" from the paragraph and now it is
working fine :)
But in addition to my 1st two point (1 & 2) I am having one small doubt
regarding the translation i.e. What is the best approach of creating a
translation file?
Should I create complete line wise converstion (even if it is using some
common words)? E.g. If I am having a string say ..
"Welcome to my site TEST.com ... a testing site."
Now here the phrase "TEST.com ... a testing site" is a common text which
will always be used. So in this case should I convert the whole line or just
break the line to translate the common (re-usable) text?
Or should i translate each word?
Please suggest ..
ashish.sharma wrote:
>
> Thanks for your reply ..
>
> I have some more issues in Zend_Translate ..
>
> 1. How could I find that this is the best time to split the translation
> file into 2 or 3 files? I mean, how could i find the size of translations?
> What is the max. size for 1 translation file?
>
> 2. In your suggestion "Initiate Zend_Translate in the bootstrap with the
> general (and small)
> translation source." what did you mean by "general (and small) translation
> source"? Is that I should I have all the common translation code (used in
> all the VIEWS) into one gerneral file and some view specific code into
> another files? If YES, then where should I initiate the rest of the (other
> then general) translation files?
>
> 3. One more MAJOR issue which i am facing is I have convereted .mo file in
> FRENCH in utf-8 encoding but when i open my site for french, that is
> changing my browser's character encoding setting to
> "Western (ISO-8859-1)" which is not displaying me the correct conversion.
> If I manually change my browser's encoding setting to UTF-8 then it
> displays the correct translation for french but on page refrech it again
> reset to Western (ISO-8859-1). Could anyone please suggest something for
> this?
>
> 4. I have a small paragraph (of 2-3 lines) in english which needs to be
> converted to french. I have added the translation too and successfully
> converetd the .mo file but it is not converting the paragraph text. It is
> converting the ONE LINER text but NOT a complete paragraph. What should i
> do for this? Is there is anything else which i have to do for paragraph
> conversion?
>
> I know my problems are quite strainge but this is what I am facing :(
>
> Could anyone help in this ...
>
> Ashish Sharma
>
>
>
>
> Thomas Weidner-2 wrote:
>>
>> Hy Ashish,
>>
>> One of the approaches you can use if you have large sources is:
>>
>> Initiate Zend_Translate in the bootstrap with the general (and small)
>> translation source.
>> Use Zend_Registry to persist the Object.
>> Within your view extend the existing object with addTranslation and the
>> used
>> translation source.
>>
>> Simply said:
>> Best is to split the source files into several ones related to what you
>> need
>> in which view.
>> But don't split it into one file per view. This would increase your
>> loading
>> time.
>> How much translations/views you should to integrate into your source file
>> depends on the size of your translations.
>>
>> Long translations -> smaller files and visa versa...
>>
>> Greetings
>> Thomas
>> I18N Team Leader
>>
>>
>> ----- Original Message -----
>> From: "ashish.sharma"
>> To:
>> Sent: Monday, July 30, 2007 11:49 AM
>> Subject: [fw-general] What is the best approach for using Zend_Translate?
>>
>>
>>>
>>> Hi ALL,
>>>
>>> I am new to zend and still in learning process. Currently I am working
>>> on
>>> Zend_Translate and would like to know the best approach to use the
>>> Zend_Translate.
>>>
>>>
>>> I am able to create .mo files and getting the translated content. Now, I
>>> would like to know the best way of getting the translated text so that i
>>> can
>>> use the same easily into my views.
>>>
>>>
>>>
>>> Earlier I have created the Translate object into the controller and then
>>> assign the translated value to a view variable to get it displayed.
>>>
>>> Code :
>>>
>>> $this->view->lang = $this_request->getParam('lang');
>>>
>>> Zend_Loader::loadClass('Zend_Translate');
>>> $translationFilePath = '../languages/' . $this->view->lang .
>>> '/LC_MESSAGES/source-' . $this->view->lang . '.mo';
>>> $translate = new Zend_Translate('gettext', $translationFilePath);
>>>
>>> $this->view->welcomeText = $translate->_('Welcome User');
>>>
>>> But if I use the above code then I have to use the same code in each
>>> controller for almost each view and this is what I don't want.
>>>
>>> Then I have created a View helper having a function "translate", taking
>>> messageString as an argument. This function loads the .mo files and
>>> return
>>> the translated string. But I don't think that it is a good approach as
>>> it
>>> loads the .mo file each time i call translate() function :confused:
>>>
>>> Can anyone suggest the best approach of doing this task?
>>>
>>> 1. What if i load the .mo file in the bootstrap file and store it's
>>> object
>>> into Registry to use it latter? Is it ok? Considering that I am having
>>> some
>>> large data for translation.
>>>
>>> Please suggest!
>>>
>>> Ashish Sharma
>>> --
>>> View this message in context:
>>> http://www.nabble.com/What-is-the-best-approach-for-using-Zend_Translate--tf4168938s16154.html#a11860632
>>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>>
>>
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/What-is-the-best-approach-for-using-Zend_Translate--tf4168938s16154.html#a11994426
Sent from the Zend Framework mailing list archive at Nabble.com.