I have cake 3 fresh installation.
I have a simple po file in this location src/Locale/de_DE/default.po with the following content.
msgid "test"
msgstr "test in german"
On my home page template file I have simple <?php echo __('test'); ?>
I need to set the locale on the fly, so I add this to my AppController's beforeFilter(or initialize) - I18n::locale('de_DE'); however test is not being translated. I can't figure out, what Im missing. I tried renaming all to iso2 - de, but it did not translate either.
Thanks
Open your Terminal, cd to your project folder (the one which contains the bin folder) and type:
bin/cake cache clear_all
That's all. Refresh your page right after.
One last thing, be sure to place your .po files in:
Locale/de_DE/your_translations.po
I like to use POEdit to manage my translations. Cheers.
Maybe this helps:
If you are working on a local maschine and use bin/cake i18nto generate the translation files, make sure the files are readable by your local webspace.
This drove me cracy.
Hi i am getting one problem in adobe dreamweaver CS3.
Currently dreamweaver not supporing to find any text from .ctp file in the entire project. I can see here it supports .php, .js, .html etc. So i am unable to search .ctp all files in entire project.
Ex-
Suppose i want to find $this->webroot in the entire project. When i search it says Done, Not found in 1366 documents. But i wrote this text in my default.ctp file
screenshot
How to search .ctp file. There is no any configuration for change the extension?
Thanks
For Configure/Opening CakePHP CTP Files in Dreamweaver 3 files that you need to edit:-
C:\Program Files\(Adobe or Macromedia)\(Adobe )Dreamweaver(version like 8 or cs3)\configuration
Open up “Extensions.txt” and on the first line at the very end add THTML and CTP separated by commas, so the line should read:
,MASTER,THTML,CTP:All Documents
Similarly add these two extensions to the “:PHP Files” line.
PHP,PHP3,PHP4,PHP5,TPL,THTML,CTP:PHP Files
Next open the “DocumentTypes” folder and edit the “MMDocumentTypes.xml” file, just open it up using notepad or wordpad. Search for the line which has an id “PHP_MySQL” and add the THTML/CTP file extensions to both the “winfileextension” and “macfileextension” so the line should read:
winfileextension=“php,php3,php4,php5,thtml,ctp”
macfileextension=“php,php3,php4,php5,thtml,ctp”
The final file is another version of the “Extensions.txt” which is located in your “Documents and Settings” Folder in my case this is “C:\Documents and Settings(User_Name)\Application Data(Adobe or Macromedia)(Adobe )Dreamweaver(version like 8 or cs3)\configuration” just add the very same things you inserted earlier in “Extensions.txt” .
I have bunch of files that need to have a (.) dot removed from the file-name. Eg. "Mr.-John-Smith.jpg" to "Mr-John-Smith.jpg". I don't have real experience with programming and know only html/css and a little javascript. I found another identical question here on stackoverflow, but what I gathered it was fixed on linux system and BASH was used.
Anyways, if anyone could provide me a tutorial on which program to use for this and what code to execute in that program to make it happen I'd be grateful.
if you are using a windows environment (which i guess you do)
you can download this free utility to mass change file names !
main page :
http://www.bulkrenameutility.co.uk/Main_Intro.php
download page :
http://www.bulkrenameutility.co.uk/Download.php
its easy to use
enjoy
If your file names in a file...
1- Open Microsoft Word or any text editor. Press ctrl+h and then search "." without quotes then replace it with blank character.
2- It will remove all dots, again bring "." to your file extention such as .jpg , .png searh your file extention for example "jpg" and replace it with ".jpg"
It will works %100, i am using this method everytime.
if they are not in a file and if you want do somethings in your operation systems' file system
Try this program. It is very useful for this operation;
Download
To remove all except the extension dot from all files in a directory, you can use PowerShell that comes with newer versions of Windows, and can be downloaded for older versions;
Line breaks inserted for readability, this should go on one line;
PS> dir | rename-item -newname {
[System.IO.Path]::GetFileNameWithoutExtension($_.name).Replace(".","") +
[System.IO.Path]::GetExtension($_.name); }
What it does is to take the file name without an extension and remove all dots in it, and then add back the extension. It then renames the file to the resulting name.
This will change for example do.it.now to doit.now, or in your case, Mr.-John-Smith.jpg to Mr-John-Smith.jpg.
I use cakePHP 2.0 and use the console tool to create one .../app/locale/default.pot . Now, I would like to get my site translated into multiple languages. I read the paragraph about internationalization in the cakephp cook book (http://book.cakephp.org/1.2/en/view/162/Internationalizing-Your-Application).
I copy the default.pot files into
.../app/locale/eng/LC_MESSAGES/default.pot
.../app/locale/fre/LC_MESSAGES/default.pot
.../app/locale/pol/LC_MESSAGES/default.pot
...
And enter the tranalations string with an utf-8 text editor (as gedit). And ... my site do not get translated at all.
I have noticed the AppController may implement some code to change the Configure::write('Config.language', some_three_letters_language), as the configuration changed nothing, I have implemented some very simple code.
// in AppController
public function beforeFilter() {
Configure::write('Config.language', 'fre');
}
Why does the translation function always return it arguments and not the translated string in .pot files ( in views, __('Something') -answers-> 'Something')?
I found nowhere were .pot files are translated into .po. How can I get those .po files, with REHL or CentOS (cannot get any suitable packet with po or poeditor in the name)?
Thanks for your answer.
.pot and .po files are the same file format. .pot stands for "PO template". The difference being that you're supposed to use this template file and give it to your translators, who will produce the translated .po files. The .pot file is the template for several localized .po files. See http://www.gnu.org/software/gettext/manual/gettext.html#Files.
In other words, just renaming .pot to .po will do.
In the proper gettext workflow, there's the msginit tool for doing this, which will also set a number of headers to the correct values for the chosen locale.
I am trying to figure out how to start using SASS files in Dreamweaver.
The error message I get when trying to open is: "Can't find a valid editor for this file extension".
All my SASS files are valid and open well with Eclipse.
Thanks in advance to anyone who could post any tips on this one.
OK. I have found the answer.
All you need to do is open Dreamweaver, go to Edit> Preferences> File Types / Editors
and in the top text box ("Open in code view:") listing various files extensions add .sass.
That's it. Rest is down to haml and compass.
I hope this post will help anyone having similar problem.
To go even further and make Dreamweaver treat .scss files as .css files (applying code coloring and indentation), just follow the instructions on this Adobe TechNote
The visual28 link no longer works. Here is a quick rundown from here
DreamweaverCS?/Configuration/DocumentTypes/MMDocumentTypes.xml
If Windows change winfileextension="css" to winfileextension="css,scss"
If Mac change macfileextension="css" to macfileextension="css,scss"
For older Dreamweaver:
http://www.visual28.com/articles/less-scss-syntax-highlighting-in-dreamweaver
For Dreamweaver 5.5 and above:
http://forums.adobe.com/thread/861133
instead to go in your installation directory to find the 'MMDocumentTypes.xml' file, GO to
C:\Users\\AppData\Roaming\Adobe\Dreamweaver
CS5?\en_US\Configuration\DocumentTypes\MMDocumentTypes.xml
and then find winfileextension="css" and change it to winfileextension="css,scss"...
That would definitely work..
Update to the latest version of Dreamweaver
Ensure that ‘Show hidden files’ is enabled in Control Panel > Folder options
Open your user folder eg C:\users\Dylan\ replacing with your name
Then open AppData/Roaming/Adobe/Dreamweaver CS6/en_US/Configuration/
Open the file Extensions.txt
Replace the first line with the following:
HTM,HTML,SHTM,SHTML,HTA,HTC,XHTML,STM,SSI,JS,JSON,AS,ASC,ASR,XML,XSL,XSD,DTD,XSLT,RSS,RDF,LBI,DWT,ASP,ASA,ASPX,ASCX,ASMX,CONFIG,CS,CSS,LESS,SCSS,CFM,CFML,CFC,TLD,TXT,PHP,PHP3,PHP4,PHP5,PHP-DIST,PHTML,JSP,WML,TPL,LASSO,JSF,VB,VBS,VTM,VTML,INC,SQL,JAVA,EDML,MASTER,INFO,INSTALL,THEME,CONFIG,MODULE,PROFILE,ENGINE,SVG:All
Documents
Replace the following line:
CSS:Style Sheets
With
CSS,LESS,SCSS:Style Sheets
Save and exit the file
Go to the folder DocumentTypes
Open the file named MMDocumentTypes.xml
Replace the line beginning with:
=>documenttype id="CSS"
with
<documenttype id="CSS" internaltype="Text"
winfileextension="css,less,sass,scss" macfileextension="css"
file="Default.css" writebyteordermark="false" mimetype="text/css" >
Save and exit the file, and restart Dreamweaver
Syntax highlighting now works