"Missing or unspecified Language attribute" when importing snippets - visual-studio-2017

When importing a directory containing snippets in the Code Snippet Manager in VS2017 (v15.7.5), in the Output pane I get the warning
Missing or unspecified Language attribute
even though a language attribute is present. I even get this when importing Microsofts own snippets. The snippets are for C#.
How to import the snippets?

At the top of the Code Snippet Manager there is a dropdown where you have to select the language for which you're importing snippets; if a different language is selected you could get this warning.

Related

Create new language in mid-project

Was requested by the client a new language to add to the project in sitecore. I'm having some issues with that,
I've created the language, however all the renderings are empty for the new language.
There's no version assigned to any item for the new language also.
I tried to do a trick that was to export the English language and open the generated xml file and rename the tags , to the requested language and then import. But when I'm trying to import it, shows as I was importing English language and not the new one.
How can I create a new language with all the renderings and content (even if it goes to english when empty string, I know it's default procedure) ?
Thanks
You can use Powershell script for that.
See e.g. this blog http://www.coreblimeysitecore.com/blog/create-language-versions-using-sitecore-powershell/
Sample code is
Add-ItemLanguage -Path "master:\sitecore\content" -Language "en" -TargetLanguage "de-AT","de-de","en-za","fi-fi","fr-be","it-it","pl-pl","ru-ru","sv-se","fr-fr" -IfExist OverwriteLatest -IgnoredFields ""
And here is a very similar question on http://sitecore.stackexchange.com site:
https://sitecore.stackexchange.com/questions/1584/create-new-language-version-for-content-branch

PyCharm not doing full syntax coloring for a specific file name

In my Django projet, I have one models.py file that PyCharm is only partially syntax coloring: it's coloring the Python keywords and comments but not other things it normally does like coloring method names, keyword parameters. This is the only file in my project like this -- all other .py files are fully syntax colored.
It's the file name not contents that is the issue. I know this because when I rename the file, PyCharm immediately fully syntax colors it. When I rename it back to models.py, it goes back to partial coloring.
Note it's not just the syntax coloring that's off -- it's also other code analysis-related tools for this file.
What could be causing PyCharm to be treating this one file differently?
In the PyCharm status bar, there is a "Highlighting level" indicator. Clicking on it allows you to choose the highlighting level between "None", "Syntax" and "Inspections", and the selected value is persisted per file. Please try clicking on it and making sure that the level is set to "Inspections".

Sitecore Import language file feature - does it create language versions?

Can anyone tell me what happens if I export a language file, rename all the language nodes to a different language (e.g. from en-US to en-GB) and then import it?
Are new language versions of the relevant items created? Or is content only imported if the language version exists?
Edit: corrected typo in title
Yes, the new language versions are created. However, the language item itself is not created (if it doesn't exist before). Hence, if you run a Database Clenup afterwards, for instance, it will remove these item versions.

How to get multiple language sites set up in Sitecore?

I am just starting to add support for multiple languages on my site... having a spot of trouble. Here are the steps I've taken so far:
In Control Panel -> Globalization, added a new language (German)
Added a new <site> definition in Web.config with hostName="localGerman.com" and language="de". Also added an alias in my hosts file for localgerman.com to point to localhost and added the host header in IIS.
Went to an item in my tree and added a new version for German. Published whole site.
Now, the host/site setup seems to work OK. When to go to http://localgerman.com/ I get my home page, with lots of missing data... there is no German version... so seems to be using the correct language.
However... when I go to the item I've added a German version of, I still get blank data. In the debugger, I can see that Sitecore.Context.Item is the German version... but all the fields are blank. Item["Content"] returns an empty string. If I manually set the language to "en" on the URL (http://localgerman.com/myitem.aspx?sc_lang=en), then I get the English version with data.
What am I missing here?
Also... when loading the German home page... my menu is blank. Presumably because the items which generate this content do not have German versions. I was under the assumption that when a language-specific version for a given item could not be loaded, then the default language version is used? But this does not seem to be the case. Am I wrong?
OK, looks like I just had the language code wrong. Setting the site language to "de-DE" instead of just "de" worked.
This is a little confusing because the default sites use language="en" instead of en-US.
You added a German version of an item, but did you fill in the fields in German ? Any localizable fields (non-shared) will be empty by default when a new version is created. It sounds like you did the other parts correctly.
The menu being blank is expected: When you try to get an language version of an item that doesn't exist, Sitecore will return null.

paste code with syntax colors and alignment

I am looking for some blog site where i will be able to directly paste c++ code examples
in my publishes and see the code with all the alignments and colors like i see it on pastie.org.
I need all those things be made automatically because i don't know HTML and can't make by myself the code changes.
Get wordpress + WP-Syntax.
You won't be able to "copy and paste" the code directly, but you'll have to wrap it like this:
<pre lang="c++">
CODE GOES HERE
</pre>
I use this JavaScript for syntax highlighting in blogger. It's very easy to use.
The key feature of above highlihter is that script permanently hosted on http://softwaremaniacs.org/, so that make it possible is to use script on blogger.com.
Another one nice syntax highlighter could be found at code.google.com (it could be integrated in blogger.com).
(source: googlecode.com)
I use the "Online syntax highlighting" at http://tohtml.com
Paste your code in the text box there, select the programming language and color scheme and it will generate a webpage with your syntax highlighted code. Copy and paste that into your blogger editor and you are good to go.