Change language mode for multiple files - visual-studio

apologies if this is a silly question, but does anyone know if it's possible to change the language mode for a bunch of files at once? I'm working on a project with hundreds of Jinja templates, but as all the files are .html I have to manually switch the language mode for each one to get the correct syntax highlighting.
Ideally I'd just like to select them all in the file sidebar and update the language settings for each file, but I imagine pretty much any solution would be quicker than the current method!
Cheers! :)

VSC does not store the languageId of the file, it uses the file extension that can be overruled by a setting.
Add this to your project settings in .vscode/settings.json
"files.associations": {
"*.html": "jinja"
}

Related

Testing Firefox Add-on/Extension Internationalization

I have created a Firefox Add-on using jpm and I have added a number of localization files such as:
locale/da.properties
locale/en-GB.properties
locale/en-US.properties
locale/fi.properties
And so on...
In my HTML files I use attributes to set these values, for example: data-l10n-id="ext_panel_heading_text".
I know the translations are working, because changes I make to values in en-GB.properties are reflected in my add-ons HTML page.
I've tried navigating to Options > Content > Choose... (under languages), removing English and adding another language (such as Finnish), however it doesn't seem to have an affect on the .properties file loaded by my extension. I also tried restarting Firefox after changing the language.
My question is: How do I test the different languages?
The language of Firefox is dependent on the activated language pack, or for Windows and Mac I believe it is hard coded into the build.
Language packs are available from https://addons.mozilla.org/en-US/firefox/language-tools/
The only way I know is to change general.useragent.locale to the locale you want to use (en-GB, da, en-US, fi) in about:configand then restarting your browser: that way your add-on should show localized texts.
As an alternative, you can use Quick Locale Switcher, which does the same but it's a little more friendly.

Magento Templates - Can extensions be bundled with a theme?

I have a real noob Magento question. I'm helping a friend change the template their store is using but they are worried about losing the functionality of some of their extensions such as ajaxsearch. They don't know if it's actually an extension or part of the template. I can't seem to figure out if some of the extensions are built into the theme or if they are completely separate extensions. Is there an easy way to tell?
To give an example the ajaxsearch JS file's path seems to in the template path e.g http://www.example.com/skin/frontend/default/templatename/js/ajaxsearch.js
and if I go to system > configuration I can see it listed in the sidebar under Templates-Master (which I think is a brand name). In this case is this an extension and is this how file paths work for extensions? The fact that skin is in the file path is throwing me off.
Thanks!
Fast way:
Each Magento extension provided as archive (.tgz). Unpack it to some folder outside Magento and check have it next path or not:
unpacked_folder/skin/frontend/default/templatename/js/ajaxsearch.js
(another trick is look in the first lines of ajaxsearch.js file, authors often write extension or theme names in it).
Long way:
Find where is this file included on page. Search for 'ajaxsearch.js' in xml files placed in app/design/frontend/default/templatename/layout/
if not found, try to search in app/design/frontend/default/default/layout/ etc.
For example you find it in somefile.xml
Try to find which extension include this file. For doing this search 'somefile.xml' in config.xml files in local and community pools:
app/code/local/some/extension1/etc/config.xml
app/code/local/some/extension2/etc/config.xml
app/code/community/some/extensionN/etc/config.xml
etc
If you found it in ...some/extensionX/etc/config.xml - this mean what ajaxsearch.js belongs to some_extensionX extension. If not found - it belongs to theme.

disable auto-complete in file type in sublime text 2

Is there any way of disabling the default snippet/autocomplete options in a file type? I'm currently using hayaku to speed up my sass/scss writing and I find that the default snippets keep getting in my way.
You can override the defaults by setting your own snippets with the same keyword. You can also set a file scope to affect only specific ones so the rest of your Sublime still works normally (If that's your thing).
Also from looking at their github page, you can set a few options in this file to suit your needs: Preferences.sublime-settings
Here's how you can make a snippet:
http://www.webtempest.com/sublime-text-2-how-to-create-snippets/

Trouble Translating Magento

I'm developing a shopping site using Magento, but I'm since the site needs to be for spanish-speaking people, I need to translate the site into spanish. I downloaded some .csv files to make the translation but they're not working. I've even tried to make changes on the english .csv files, changing the statements to spanish but it's still not working. Any ideas of how to make this issue work?
Thanks in advance!
Make sure, that your csv files are located in selected locale (i think /app/locale/es_ES) and this locale is selected in admin for your StoreView (System -> Configuration -> General -> Locale options)
Clear cache after changing csv files
Just found it, you need to go to system > configuration > developer > translate inline, there yoou have to eneable the changes in the backend or in the front end and thats it. Its a really hard way to get it going, but it works. Any other suggestion is welcome.

Markdown syntax highlighting in SciTE/Notepad++

I'm looking for a .properties file for Markdown syntax in SciTE. Is it possible?
A partial highlighter would do, otherwise.
I'm using this syntax file: https://github.com/leafnode/markdown_npp with some color changes to fit dark background.
I've uploaded my (dark) user-defined language Markdown highlighter on GitHub. It uses different workarounds than thomsmits', which for the style of Markdown I've chosen work better.
Until the Markdown Scintilla lexer is imported into Notepad++, user defined languages are the best we can do.
I don't use Notepad++ any more and have deleted my project. Try Brettz9's fork of the project here: https://github.com/brettz9/Notepad---Markdown-Highlighting
I'm using Markdown-plus-plus. The install instruction is outdated on many projects. The actual instruction is:
Select menu "Language" → "Define your language..."
Press button "Import...", and select {markdown}.xml (from GitHub repositories).
Restart Notepad++
I believe somebody mentioned on the mailing list that he is working on such a lexer.
I don't think a simple .properties file can do the job, as there isn't any existing lexer (to my knowledge) with similar syntax.

Resources