w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
QLocale detects system language incorrectly on Windows with language pack installed
When I was working on Localization in Qt, I used QString locale = QLocale::system().name(); When I tested getting the locale, I found it was dependent on the Format in the Region and Language settings: Control Panel > Region and Language > Format Hope that helps.

Categories : Windows

Get keyboard language or detect user input language in Android
No. There's a phone locale, but the keyboard may ignore it by design (many keyboards allow you to switch languages just within the keyboard for bilingual users). There's no API for the keyboard to report it has done so to the OS.

Categories : Java

How can i fix language for the grammar does not match the language of the speech recognizer error in vb
I have worked this out. You can fix this by using this code before declaring the recogniser First import this Imports System.Threading Imports System.Globalization Secondly add this Thread.CurrentThread.CurrentCulture = New CultureInfo("en-GB") 'or your current language and country' Thread.CurrentThread.CurrentUICulture = New CultureInfo("en-GB") 'or your current language and country'

Categories : Vb.Net

Serving a language file depending on language preference settings
The way I'm doing it is to keep several separate language files, figure out the browser's language setting and then load the appropriate file. Here's the function I'm using (most likely not perfect, but it does what you'd expect): function loadLanguage() { "use strict"; if (window.navigator.language) { LocalLanguage = window.navigator.language; } else if (window.navigator.userLanguage) { LocalLanguage = window.navigator.userLanguage; } else { LocalLanguage = "en"; } var fileref = document.createElement('script'); fileref.setAttribute("type", "text/javascript"); switch (LocalLanguage) { case "cs-CZ": case "cs": LocalLanguage = "cs"; fileref.setAttribute("src", "Language/cz-CZ.js"); document.getElement

Categories : Javascript

2 menus in different language points to same menu in main language
I did the same thing in the last week. You should have something like this: Two articles in different languages, or one common article. Then you choose in menu the type (e.g. single article) and set the title of the first menu item to loginasEN, and the second to loginas. Both are child of pages menu. For each submenu you choose the article in the specific language (en/lt), or the same article (e.g in your case english) to both sub-menus of pages. This is the common procedure. And it works perfectly. Joomfish is a great help.

Categories : Joomla

Retrieve tweets language or filter by language with TwitterStream
I don't think you can rely on iso_language_code - I couldn't find reference to it in the REST or streaming APIs. Tweets do have a lang attribute which indicates the language that the Tweet was written in. This was recently added to the API and, unfortunately, Twitter4J does not yet provide you with access to it. There is a task to add it in version 3.0.4 but the work does not to appear to have started yet. Unfortunately you'll need to wait until they add it or perhaps you could give them a hand and submit a pull-request.

Categories : Java

difference between meta language and markup language?
Markup language:- A (document) markup language is a modern system for annotating a document in a way that is syntactically distinguishable from the text. The idea and terminology evolved from the "marking up" of paper manuscripts, i.e., the revision instructions by editors, traditionally written with a blue pencil on authors' manuscripts. In digital media this "blue pencil instruction text" was replaced by tags, that is, instructions are expressed directly by tags or "instruction text encapsulated by tags". Metalanguage metalanguage is language or symbols used when language itself is being discussed or examined.1 In logic and linguistics, a metalanguage is a language used to make statements about statements in another language (the object language). Expression

Categories : HTML

Wrong language fonts at multi language app
the problem is that your phone doesnot supports unicode characters for greek, there are two solutions, 1)It means that fonts your device uses do not support greek characters (hence unknown unicode). You need to find better font and use it in your application (see http://developer.android.com/reference/android/graphics/Typeface.html docs) 2)get online unicode converter or google translator for english to greek and copy the words to your strings.xml

Categories : Android

assembly language - c-language and mnemonics
This prepares the arguments to call a function __main that probably does all initial setup that is needed for a C program andl $-16, %esp subl $16, %esp call ___main This prepares the arguments and calls function _puts. LC0 is a symbol that contains the string to be printed. movl $LC0, (%esp) call _puts This prepares the return value of main and returns movl $0, %eax leave ret

Categories : C

C# Script Language vs. Own Language
If you want to go the hard way, I would recommend spending the next 6 months or so trying to write your own "compiler". If you want an easier way, I would recommend you offer scripting in actual C# language and use CodeDOM to compile and execute. In order to properly use the generated/compiled assemblies I recommend you force the usage of interfaces by the end users and use Dependency Injection in your application. EDIT : Following your edit on the question. To be honest I have no clue about neither Lua or IronPython, but something I know for sure: you should NEVER EVER try reinventing the wheel. DON'T try writing your own language. I do remember spending 3 months trying to write my own small ORM (SQL Generator for Dapper) to end up by suddenly discovering ServiceStack ORMLite which was

Categories : C#

Jquery datepicker and Spring Locale. Change datepicker language with locale language. How to?
I used this code snippet in a project once. Hope it helps: $(function() { calendar(); }); function calendar(){ //omitted datepicker init $(".calendar").datepicker("option", $.datepicker.regional["<%=locale%>"]); } All date field's css attributes are specified as calender and locale is retrieve in java code. I'm not familiar with CookieLocaleResolver, I used SessionLocalResolver but there should be equivalent way to get the Locale. public static Locale getLocaleFrom(HttpSession session) { return (Locale) session .getAttribute(SessionLocaleResolver.LOCALE_SESSION_ATTRIBUTE_NAME); } And I remember we modified the datepicker for different locale values between Java and datepicker. You could use a mapping mechanism as an alternative solution.

Categories : Javascript

Prestashop 1 Language URL
You need to override the Link class. Create a new file /override/classes/Link.php with the following content: <?php class Link extends LinkCore { protected function getLangLink($id_lang = null, Context $context = null) { return '/'; } } Do not forget to remove the /cache/class_index.php file (which is a cache for the override file).

Categories : Htaccess

Django set the language
As read in the docs TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.i18n, ) You should have that in your TEMPLATE_CONTEXT_PROCESSORS setting. Now try to move up the Locale middleware like this: MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', ) The order of middleware counts and locale should come after session. It would be really hard to guess what will the problem be because there are many details in the process but it is quite well explained here. That's t

Categories : Django

How to prepare for language changes?
The differences are usually only noticeable to users who use specific functionality that isn't often used on most websites. If you learn JavaScript right now, you will not be lost in any way when ECMAScript6 is out, the only difference it will make is that there will be new functionality that you may or may not find useful for your use cases, and which you can choose to use or not. In short : Don't restrict your learning because a new version will come out, it won't negatively affect you in any way. EDIT : In fact, firefox already supports some functionality from ECMAScript6 : https://developer.mozilla.org/en-US/docs/Web/JavaScript/ECMAScript_6_support_in_Mozilla

Categories : Javascript

JS - Replace language
//GLOBAL var LANGUAGE = "en"; // if english is default //on bodyload $("#type").change(function(){ LANGUAGE = $(this).val(); }); //wherever you want to use it language : (div.lang && div.lang != "") ? div.lang : LANGUAGE, For the Comments: enum just wasting ressources (in my opinion ==> btw thanks ;) ) use my code is based on jquery on bodyload can be put into jquery on domready, html on bodyload, etc For pure JS: // HTML: <select id="selectLanguage" onchange="languageChange"> // JS //// Global Var in JS (placed on top) var LANGUAGE = "en"; //// function placed anywhere function languageChange(){ LANGUAGE = document.getElementById("selectLanguage").value; } //// wherever you want to use the line language : (div.lang && div.lang != "") ? div.lang :

Categories : Javascript

Can I have App name as English + Some other language?
You can set a mixed English/Arabic name for the app in the Info.plist. The key you are looking for is “Bundle Display Name” (CFBundleDisplayName). By default that key value is ${PRODUCT_NAME}, but you can change it to any string you want (even with Arabic characters). Mind that the space in the home screen is limited, and you cannot use long names under the icons. Your proposed name seems to be a little bit long and shows like “My…التطبيق” in my Simulator.

Categories : Iphone

Ex 1-8 The C Programming Language
First of all, you should not be using or getch/getche, those are not standard C. Your issue when you are using getche in the loop is that this function on MS Windows does not process end-of-file controls. In general, the first getchar() call will not return until after you've pressed enter for the first line, so if you're expecting it to "enter the loop" immediately, you're mistaken. Just keep typing and hit enter.

Categories : C

how to know powerpoint language with vba
The following returns the user-interface language as a code number: MsgBox Application.LanguageSettings.LanguageID(msoLanguageIDUI) I'm in the UK and this returns 1033, even though this number is for the US. If you search (Microsoft or MSDN) you can find a list of these code numbers. A quick search yields this.

Categories : Vba

What does embedding a language into another do?
Because they're scripting languages, the code is always going to be "interpreted." In reality, you aren't "calling" the script code inside your program, but rather when you reach that point, you're executing the interpreter in the context of that thread (the thread that reaches the scripting portion), which then reads the scripting language and executes the applicable machine code after interpreting it (JIT compiling kind of, but not really, there's no compiling involved). Because of this, its basically the same thing as forking the interpreter and running the script, unless you want access to variables in your compiled program/in your script from the compiled program. To access values to/from, because you're using the thread that has your compiled program's context, you should be abl

Categories : C++

PHP macro language?
It would definitely be possible to write your own macro language or template engine. The question is how much time you want to invest in this project and how ambitious you are about it general. In most cases it is more productive to use something that is already there instead of reinventing the wheel. This way you can use and learn a sophisticated technology and once you've got the gist how it works you will be able to either write your own version of it or to modify what you have used so far and maybe you will end up contributing to an open source project which helps the whole community. Take a look at Smarty for example but don't stop there. Do a bit of research to see what is available and to what extend it fits your use case.

Categories : PHP

.NET Assembly language
IL/MSIL is an assembly language targeted to the .NET virtual machine :-) The Disassembly window shows the assembly language of the program after it's jitted, so the assembly language of the "real" CPU (normally an Intel). By using ngen you can compile your .NET app to "native" machine code. From there you can probably use a "standard" disassembler to watch inside it.

Categories : Dotnet

How to design a DFA for the following language?
I would construct this in two steps: Construct a DFA whose states keep track of the remainder of w when divided by seven. You can do this by constructing states 0, 1, 2, 3, ..., 6 and linking them as follows: if w leaves a remainder of r when divided by 7 and the next digit is d, then you want to end up in the state corresponding to 10r + d (mod 7). This will give ten outgoing links from each state. It will be annoying to compute these links, but you only have to do it once. Mark states 1, 3, and 5 as accepting and everything else as rejecting. Hope this helps!

Categories : Misc

Add language key into script src via jsp/esp
Instead of <%= liferay-ui:message key="captchalang"%> use <liferay-ui:message key="captchalang"></liferay-ui:message> because this liferay thing is apparently a tag library. That also means at the top of your JSP you will need to include the tag library. It should look something like this: <%@ taglib uri="http://liferay.com/tld/liferay-ui" prefix="liferay-ui" %> and you will also need to put the jar file of the tag library in the right spot on the server.

Categories : Jsp

Supporting the Filipino language
There is no ISO 639-1 code for Flipino. Hence, I am not aware that you can write an app that offers Filipino translations, as Android uses ISO 639-1, not ISO 639-2 (where fil would be valid).

Categories : Android

Android Ukrainian Language
Try using DateFormat.getDateInstance(int style, Locale locale) instead of creating your own patterns with SimpleDateFormat.

Categories : Android

Comparing arrays in Go language
If you have 2 int slices/arrays try this: func IntArrayEquals(a []int, b []int) bool { if len(a) != len(b) { return false } for i, v := range a { if v != b[i] { return false } } return true } NOTE: this is for 1D arrays, but you can rewrite it for 2D.

Categories : Arrays

For Drupal modules, is PHP the only language used?
Drupal is a PHP application and there is no bridge, neither in PHP or specifically for Drupal, to allow easy development of module using other languages. But since a Drupal module is essentially a collection of functions whose names follow a known convention, it should be possible to write module in language that can be compiled to PHP or that could be exposed as PHP functions by the used PHP runtime. Unfortunately there is not many language that can be compiled to PHP. A quick Googling returns Snow. Because a PHP extension expose PHP functions, C should be usable to write a module's functions. It might also be possible to use the Quercus PHP engine (100% Java implementation of PHP 5) to allow module to be written in Java. In all cases, these options are likely highly experimental and not

Categories : Drupal

Loop over array in Go language
What's wrong with i := 1 for _, v := range array { // do something i += 4 } if you want i-values other than indices, or if you want to skip the indices, for i := 1; i < len(array); i += 4 { v := array[i] } ?

Categories : Arrays

YouTube API v3 language filter
There is no language filtering in Youtube API v3. The only thing you can make with Youtube API v3 is you can use the region code such that GET https://www.googleapis.com/youtube/v3/search?part=snippet&q=is&regionCode=YOUR_REGION_CODE&key={YOUR_API_KEY} However, it most probably will not do what you want. Therefore, you should use some external language filtering libraries

Categories : Api

How to set default cms language to english?
According to https://docs.djangoproject.com/en/dev/topics/i18n/ Django sets default language based on Accept-Language header. If you want always redirect users from / to /en/ than set rewrite in your web-server config. nginx example: location / { ... rewrite ^/$ /en/ permanent; ... }

Categories : Django

std::thread in C++ vs. goroutine in go language?
Or if not, does the C++ standard consider to add some features/libraries to support goroutine? what you are requesting is something like a fiber library - the forthcoming library boost.fiber contains cooperatively scheduled fibers, mutexes/condition-vairables/barriers/... - the interface is similar to boost.thread.

Categories : C++

android keyboard with different language
It's very simple. Just need to add unicode as android:codes and it will print that particular char in edittext. android:codes="0x0AE7" android:keyLabel="2"

Categories : Android

UIImagePickerController language not changed
You need to synchronize your NSUserDefaults and change it like this : [[NSUserDefaults standarUserDefaults] setValue:@"fr"] forKey:@"AppleLanguages"]; [[NSUserDefaults standarUserDefaults] synchronize]; Next you need to use the macro : NSLocalizedString(string, nil) for the text inside your UIImagePickerController. ++

Categories : Iphone

OpenCart v1.5.5.1 - Language selector
This is pretty easy to do, though it's not as simple as a URL by default. You need toPOST the relevant language code to the module/language controller to change it. The files you need to look at are catalog/controller/module/language.php and catalog/view/theme/default/template/module/language.tpl

Categories : Jquery

How to tell if a string is in a different language. (Not ASCII)
If you use Google's Library Guava, you can check if a String is ASCII or not with the class CharMatcher.ASCII. This is an example how to use it: public static void main(String[] args) { System.out.println(isASCIIString("کور")); // false System.out.println(isASCIIString("Hi")); // true } public static boolean isASCIIString( String pString ) { return CharMatcher.ASCII.matchesAllOf(pString); } EDIT: With this code, you can only check if this is ASCII or not. The output in your terminal will not depend on that, since the default OutputStream will not support this. System.out prints Unicode strings using the MacRoman charset and not UTF-8. To print your Characters, this could help: PrintStream out = new PrintStream(System.out, true, "UTF-8"); out.println(yourString);

Categories : Java

'ApplyAuthenticationToRequest' is not supported by the language
Several of our users encountered the same problem. Can you check if update NuGet to the latest version help you solving this issue? Thanks UPDATE (11/16/2013): Read my blogpost http://peleyal.blogspot.com/2013/10/applyauthenticationtorequest-errors.html and install this patch. Consider upgrading your OAuth2 library to Google.Apis.Auth. Read more about it in our OAuth2 wiki page. You should upgrade the library to version 1.6.0-beta, all you have to do is installing the latest NuGet package for your specific API (It will automatically install Google.Apis.Auth for you). Read more here.

Categories : C#

Name of day/month that's not today in another language in php
Whenever you need to manipulate date/time stamps based on locale, you should use strftime also change the encoding to utf-8 http://php.net/manual/en/function.strftime.php example : <?php header('Content-Type: text/html; charset=UTF-8'); $myDate = "Feb 21, 2013"; $locale = 'fr_FR.utf8'; setlocale(LC_ALL, $locale); echo strftime('%d %B %Y', strtotime($myDate)); $locale = 'en_US.utf8'; setlocale(LC_ALL, $locale); echo strftime('%d %B %Y', strtotime($myDate)); ?>

Categories : PHP

Language with Block scope?
ALGOL 60 was the first to use the block scope followed by many like C, C++, C#...etc Check out the Block scope section of this Wikipedia page. Advantage of having Block scope Blocks are primarily used for control flow, such as with if, while, and for loops, and in these cases block scope means the scope of variable depends on the structure of a function's flow of execution. However, languages with block scope typically also allow the use of "naked" blocks, whose sole purpose is to allow fine-grained control of variable scope. For example, an auxiliary variable may be defined in a block, then used (say, added to a variable with function scope) and discarded when the block ends, or a while loop might be enclosed in a block that initializes variables used inside the

Categories : Javascript

parse natural language
Parsing natural language is non-trivial, if you want a true natural language parser I'd recommend that you try and use an existing project or library. Here's a web based parser, based on the Stanford Parser. Or wikipedia is a good jumping off point. Having said that, if you're willing to restrict the syntax and the keywords involved you might be able to simplify it. First you need to know what's important -- you have 'things' (lights, fan) in 'places' (bedroom, kitchen) that need to go into a specific state ('on', 'off'). I would get the string into an array of words, either using str_tok, or just explode on ' '. Now you have an array of words start at the end and go backwards looking for a 'state' -- on or off. Then follow that backwards looking for a 'thing', and finally a 'place'.

Categories : PHP

Initialise Language Selection
Putting language in the session can have strange unintended effects. Sessions are .. well .. session wide. If I open two windows to your website, and I change the language on one, the language on the other will switch too when I load another page. Put the language in the URL, like: my.domain.com/en_uk/jobs my.domain.com/en_us/jobs This effect becomes even stranger when the 'next page' is not a page, but, for instance a form that I'm submitting.

Categories : PHP



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.