Magento translation fails - magento

I have trouble translating the phrase "%s was added to your shopping cart." in magento. This is a message that is called in a php-controller (cartController.php).
I use csv-files for the translation and checked them multiple times for errors (missing quotes, wrong quotes, ...), but the translation still won't work. Translating inline seems also impossible as no option is shown to translate success-messages.
I also checked the store language (which is set to Dutch), locale configuration and via code what language he finds, this all turns out fine, everything is okay.
Does anyone know what next steps I should take to investigate this problem or even better: does anyone know a solution for this problem? I found many threads like this one, but unanswered or without an answer for me.
One more thing: Yes, I cleared my cache and translations ;-).
Tx

Try to put translate.csv into your theme folder:
(root)/app/design/frontend/(theme)/default/locale/nl_NL/translate.csv
And put your translation there.

Check the encoding of your file Mage_Checkout.csv
Probably you have ANSI or UTF-8, but it should be "UTF-8 without BOM", otherwise Magento has troubles in using the translation file.

Related

Magento Translation

I have Magento 1.8.1.0. Recently I've installed Russian pack, the result wasn't appropriate enough, cause some phrases on frontend remained in English
I know there's handy way to translate Magento using cvs-files.
The question is where I can find proper cvs-file? Does installed theme concerns translation some how? I know I'm asking newbie questions, I've read several posts, but I haven't made up my mind how to translate Magento.
Many thanks in advance.
Hope you are doing well,
As i have gone through your question that you want to translate your websites front end in Russian if user has selected the language Russian.
For this you are required to work out the translate.csv files which will be available in your theme Package.
Example : app/design/frontend/default/SecuareWeb/locale/de_DE
In the locale folder you will find the folder for Russian language open that folder and you will find the file where you are required to add the required translation text in it.
How to add translation text in translate.csv file is given below.
Example:
"This is the demo of translation in Russian","Это демо-трансляции на русском языке"
And one thing i would like add is that make sure your front end .phtml files must contain the text in $this->__("Example");. If you have added all the text like this then only then it will allow you for translation other wise it will not translate a text.
Hope this might be use full to you !!!
Waiting for your valuable comments in regards to your Question !!!
There are different ways to achieve translation in Magento so you can find multiple directory containing static csv files and also a database table.
All the modes have same structure: key/value. For example: "String to translate","String translated".
Inline Translation (database table: core_translate):
following best practices in Magento, you should use inline-translation aka database saved translation in rare cases. It is harder to mantain and can be buggy. It has first precedence, so any translation you do via inline translation will override the other 'modes'.
Theme level Translation (file in app/design/frontend/your_package/your_theme/ru_RU/translate.csv):
you can place any string to be translated in the translate.csv. It has second precedence.
Locale translation (file in app/locale/ru_RU/Module_Name.csv):
the suggested way to do translation as it will keep translation separated by each module and is easier to maintain. For example: Mage_Catalog.csv etc.
Each module in Magento can specify its csv file containing translation and sometimes the same string has different modules trying to translate, so if your translation does not work check between multiple file by a quick editor search. It will be overridden by the two above modes.
Note:
Magento will load all the csv files and build up a giant tree and caches it. So before scratching your head because the string is not translated as you wished in the frontend:
1. clean the cache.
2. check for any same key string which comes after your translated string. For example: in the same csv Line 100 will override Line 1 if the key string are the same.
3. check for any same key string in the mode which has higher precedence. For example: inline translation will override any csv based translated string.
It may be easier for you to go to the admin backend System -> Configuration -> Developer and switch "Translate Inline" "Enabled for Frontend" to "Yes".
Then, refresh the frontend and you can change the translation directly at your web browser.
The translation is saved in the database table core_translate just for the case you want to do it in a test environment and copy the translation later on to the production.
Take care that without client restrictions (System -> Configuration -> Developer) everyone will see the translation options.
btw. You may need to clear the cache and refresh the webpage in order to see your changes.

Rainmeter: How to concatenate strings

I am getting data from a broken RSS feed that gives me wrong link. I wanted to fix this link so I made this code:
<link.*>(.*)&.*tid(.*)</link>
and the link could be like:
www.somedomain.com/?value=50&burrrdurrrr;tid=120
But the real working link is in this form:
www.somedomain.com/?value=50&tid=120
The thing that I'm asking is if my measure thing looks like this:
[FeedURL]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=2 ;now I only get www.somedomain.com/?value=50
Substitute=#SubstituteFeed#
How am I supposed to concatenate the strings together to complete the url?
I'm guessing rather than &burrrdurrrr;, the link has &, which is how you have to write & in an HTML or XML file.
If that's the case, you just need to set the DecodeCharacterReference option, as described in this handy-looking tutorial. Another option mentioned there is Substitute, which would be able to strip it out even if it really was &burrrdurrrr;.
None of this is a particularly sensible way of dealing with HTML or XML - a much better approach would be a plugin which actually parsed the document structure and let you reference nodes using XPath or CSS rules - but you work with what you've got, I guess. (I've never heard of this "Rainmeter" before, despite its claim to be "the best known and most popular desktop customization program for Windows"; maybe because nobody else calls their program that, instead almost universally using the word "widget"?)

How to edit the original string column in poedit?

Hi I am using poedit editor and i am not able to edit the original string column. I want to edit few words on original string column. Thanks in Advance
(Oh well, I'll answer it here as well, for the benefit of the people who may find this post. But you won't like the answer any more than when I replied to you yesterday, when you asked on the Poedit mailing and in personal email to me.)
Short answer is: you can't. Read the introductory sections of the GNU gettext manual -- it explains the basic concepts of gettext translations very well, from both the programmer's and translator's perspectives, and it's clear you don't understand the concept of gettext.
Really, I mean it: please, please, read at the lest the intro part of the manual. The fine folks from the GNU gettext project put a lot of effort into it and if you've spent 5-10 minutes with it, you wouldn't need to ask this question.
Longer version:
Gettext uses text strings (typically in English) in the source code as translation keys. And it has tools to extract the strings and put them into a PO file. This ensures that only strings that are actually used are translated.
Changing the original string (called msgid -- it really is an ID) makes no sense. You would then have a translation of a string that is never used in the source code and so the translation would be guaranteed to never be used. Way to waste the translator's time, wouldn't it?
Want to "edit a few words"? Edit them in the source code. That's the only way that can ever work with gettext.
What Vaclav is saying is very true. If you change the actual source string, the system won't read it.
In Poedit, simply select the string from the long list that you want to edit then you will see that string in the Source Text at the bottom of the screen. Then in the Translation box, enter your preferred wording. Don't forget to include any variable aswell otherwise your change won't work.
What Vaclav is saying is very false.
You can change it. Open the file with notepad. Ctrl + F the original text that you want to change. Change it, and then save it. Then open the file with po edit again, and you will see the changed text.

MediaWiki upgrade breaks File prefix but legacy Image works

Did a MediaWiki upgrade from 1.15.1 to 1.20.2 by following the simple update instructions (basically a new installation, copying over the old LocalSettings.php, update script and copying over images). Weird thing now is that all of the File: prefixes don't work. Instead the internal links to images is a "file:name of image" URL rather than "http://mediawiki address/index.php/File:name of image".
Anybody else getting this. Assuming it is something wrong with the old LocalSettings.php.
Ran the refreshLinks and refreshImageMetadata maintenance scripts without fixing the problem.
In the comments, you wrote that you have file: added to $wgUrlProtocols. This is very likely what's triggering the problem.
It looks like something has changed in the parser between MW 1.15 and 1.20 so that it's now parsing file:whatever as an external link (since it matches the file: prefix you've defined in $wgUrlProtocols) even if it's inside square brackets.
The obvious workaround would be to change the $wgUrlProtocols entry from file: to file:// so that it will only match if the slashes are there (as they should be, according to standard file: URL syntax). Since your on-wiki filenames are, presumably, very unlikely to begin with double slashes, they should not match this more specific prefix.
That said, this could still be considered a bug in MediaWiki. You may want to file a bug report about it, if there isn't one yet.
(Edit: Looks like Mark A. Hershberger filed one already.)

Set allow_url_include on SINGLE file

I've created a php file called pagebase.php that I'm quite proud of. It contains a class that created the whole html file for me from input such as css links and js links.
In any case, this file is several hundred lines long, as it includes several helper functions such as cleanHTML() that removes all whitespace from the html code then, in layman's terms, makes the source look pritty.
I have decided to use this pagebase in all my projects, particularly in all my internal projects. I also plan to add and expand to the pagebase file quite a lot. So what I'm wondering is if it's possible to set the allow_url_include option to on, but just on this one single file.
If I got my theory right, that would allow me to include() that file from any server and get the pagebase class.
So what I'm wondering is if it's possible to set the allow_url_include option to on, but just on this one single file.
No, as far as I'm aware this is not possible.
What you are planning to do sounds like a bad idea anyway, though. An include that gets loaded over the web on every request is awful for performance.
You should keep local copies of your library, and use a update script (or version control system) to keep versions up to date.
That is a bad practice.
You should put this file along with the project that needs it and locally include() it.
10 years and still no good solutions? Use this first one with allow_url_fopen for any convenient solution for your PHP file to allow the use of the php.ini brackets.
Replace allow_url_fopen in my example with allow_url_include to address the question.
This will surely be stated as a minor problem in future PHP. Especially if things aren't set up right with at least options are enabled globally. And this only works if there are no global php.ini rules.
Number 1 and 0 in code is either on and off.
<?php
echo ini_get('allow_url_fopen');
if (!ini_get('allow_url_fopen')) {
ini_set('allow_url_fopen', '1');
}
echo ini_get('allow_url_fopen');
Your code of use of either fopen() or copy() in between the code. Even some curl_init() might work.
echo ini_get('allow_url_fopen');
if (!ini_get('allow_url_fopen')) {
ini_set('allow_url_fopen', '0');
}
echo ini_get('allow_url_fopen');
}
?>
This also works for several other php.ini rules. I believe that this proof would be a security issue in many PHP codes further into the future. Surely a good thing to monitor in plugins in the further future or now for anti-malware signature. At least use the right global settings from now.

Resources