Strings in language files – double or single quotes?

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
10010110
Translator
Translator
Posts: 224
Joined: Tue Jan 22, 2008 9:57 am

Strings in language files – double or single quotes?

Post by 10010110 »

I just had the issue in http://forum.cmsmadesimple.org/viewtopi ... 73#p261273 and posted a solution, too. Now I’m wondering why language strings are written in double quotes at all? It would probably make many things easier if these files would be created using single quotes surrounding the strings since usually any variables inside these strings aren’t parsed anyway but should be printed literally.

Any thoughts on that? Is it feasible to change that in future releases?
Jos
Support Guru
Support Guru
Posts: 4019
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: Strings in language files – double or single quotes?

Post by Jos »

Gallery already uses single quotes in its language file
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Strings in language files – double or single quotes?

Post by calguy1000 »

Answer is: it doesn't matter.

I use heredoc notation, and mostly (though not always) single quotes. IIRC the TranslateCenter generates files using single quotes. It's just another one of those things that the developer has to test to ensure it's working properly.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Post Reply

Return to “Developers Discussion”