How can I use the Disqus comments in my three-language site in all three languages different? - api

How can I use the Disqus comments in my three-language site in all three languages different? I saved one language and I cannot use else.

Referencing this doc, there are a couple of ways to have a multi-lingual site:
Create as many Disqus shortnames as you need languages, and reference those shortnames in each language portion of your site where you load Disqus
Use the following javascript override to load different languages per-page:
var disqus_config = function () {
this.language = "ru";
};
Use option #1 if you want to moderate or manage each language separately. Option #2 is good if those moderating can do so in either language.

Related

Dynamically register a language

I'm writing a vscode extension and I'd like to register languages dynamically, based on user configuration. The extension would then instantiate LSP clients to talk to servers derived from user configuration as well.
This would allow for people writing custom and toy languages to get an extension "for free" and experiment with editor features without necessarily having to implement and publish the vscode part of it.
I've dug a bit in the vscode sources, and found an interface that seem like it could help : "ILanguageService", but I'm unsure as to whether this is something that's accessible from the extension API.
Any idea how I could go at it ? Is it even possible ?
Alright, so my question stemmed from a misunderstanding of how LSP clients work. They don't necessarily need to be tied to a language, and can work on a glob-pattern basis, something like
const filter: DocumentFilter = {
scheme: 'file',
pattern: `**/*.${myLanguage.extension}`
};
const clientOptions: LanguageClientOptions = {
documentSelector: [filter]
};
This seems to be sufficient for vscode to understand which LSP it should be calling

Switch to the another language on the same page?

I am trying to add a language changer for Middleman and it's not generating the correct link. My default and root is English.
url_for("/#{current_page.path}", locale: :ja)
I would expect the equivalent for the current page in JA which is the same URL with JA prepended. Does anyone know how to fix this?
I'm a middleman beginner, but after doing a bunch of Googling it seems like this is a fairly common issue. I've tried to look through the middleman sources to see if I could find a solution, but I've been unable. I'm kinda disappointed about this, because it looks like middleman has first-class support for localizations. Being unable to easily link from one to another seems like a surprising omission.
What I've done is make a little helper that can swap localizations in paths, if needed.
def change_locale_in_path(path, locale)
locale_prefix = I18n.locale
path.gsub(/^#{locale_prefix}/, locale.to_s)
end
This isn't a great solution, though. It will need to be adjusted if you change the i18n :path, and won't work unless you mount_at_root: false. But, it worked well enough for me to move on. I really would love to see a better solution.
I found a few GitHub issues that seem to reference this problem. Here's one.
I am using the following helper to generate a URL for the current page in a different language. It was originally based on this gist, and then tweaked it a bit so that it works regardless of whether mount_at_root is used.
def current_url_for_locale(loc)
url_regex = /\A\/(?:(#{I18n.available_locales.join('|')})\/)?/
locale_root = url_for('/', locale: loc)
current_page.url.gsub(url_regex, '').blank? ?
locale_root :
current_page.url.gsub(url_regex, locale_root)
end

Gracenote API: Search and fetch contents in specific language

I'm wondering if there is a way to get data in specific language when using gracenote series_search or series_fetch methods.
It turns out that using ger field is useless... I still get data in english ...
If someone could help resolving this, that would be great! =)
Gracenote uses 3-letter ISO 639-2 codes to specify languages. The format is described at http://en.wikipedia.org/wiki/List_of_ISO_639-2_codes - Gracenote supports most major languages.
Thanks to your suggestion, we've added this documentation to our page at: https://developer.gracenote.com/eyeq

rails 3.1, How to manage URLs for a multilingual website?

I would like to know please, what is the recommended way to develop a website with two languages:
Arabic ( Right To Left )
English ( Left to Right )
URLs will have a two characters to specify the language, like:
www.domainname.com/ar/homepage or www.domainname.com/en/homepage
so, the router shall be able to add ar, en for each url ...
I know that I my controller should work for both languages, but, how to pick the right css for the chosen language ? is there a blog or tutorial for this case ?
Also, as for the data base, shall I add a field of content for each language ? what's the recommended approach for that ? for reading and writing ?
Any guidance will be more than appreciated!
I would use I18n and then scope the urls, but I suggest that you read this article on I18n, to get a firmer grasp of the concept.

how to get knowing more about a class behaviour without looking at its manual?(a fundamental question about how to dive more into OOP)

I'm practicing OOP for 2 years (for real) and I know how to consume objects and packages and I'm developing stuffs mostly using C# .
but I have a problem with consuming unknown objects and packages as an instance :
for now I am working on an enterprise like website and for part of our job we need to consume RSS. I decided to use "System.Xml.Xpath"
and my real problem is:
for using system.xml.xpath I should look at manual and read it carefully and I don't want to do that every time.A plain example of that is like following code :
XPathDocument xp = new XPathDocument(sites[2]);
XPathNavigator nav = xp.CreateNavigator();
XPathNodeIterator it = nav.Select(xpath3);
foreach (XPathNavigator n in it)
{
//get elements here
}
//another way of iterating elements is
while(it.movenext())
{
//it.current.Value;
}
for the "foreeach" part I got it from MSDN manual and I guess I could get this simple fact by looking at class structure.
but I don't know which structure I should look.
I know how to read tooltips and I'm familiar with things like : [] / collection / enum /generic / Ienumerable / Idisposable etc...
but I think there is something about reading class behaviors and I'm missing that part.
for make it more lucid :
I know whenever we have a class that inherited from IEnumerable so we can use foreach statement against that class to iterate it through
my real problem is I think classes are self described enough to not to look at manuals all the time but I don't know how/where to read those descriptions of classes so I need your advice to get more familiar with how to reading classes without looking at manuals.
best regards.
Classes can (and should) be documented with source code comments, and in many languages you can generate API documentation from these comments (in HTML, XML or other format). In Java it is called Javadoc; I don't know the C# term. If this is what you call "manual", then this is your primary source of information. Other than reading the source code comments and the code itself (which you often don't have access to, especially in the MS universe). If you don't find enough information in the API documentation, you can always try googling for more explanation, tutorials or usage examples.
Hope this helps; I am not entirely sure I understood your question though. If this is not the answer you are looking for, please clarify.