w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Expressjs - All Routes Are 404
Express 404's if a request gets to the end of the middleware chain without anything sending a response. So a common reason for this is a missing app.use(app.router). In your case passport.deserializeUser(id, fn) throws an error within passport.session(). Express passes the request directly to your custom error handler, bypassing app.router. Since the error is not 'not found' it renders 404. I would probably just return a user of null in the event that User.findOne(... doesn't find a user. You will need to make sure any templates that are shown to both logged-in and non-logged-in users handles both cases. Also I use this often, it might come in handy: function restrictToLoggedIn(req, res, next){ if(req.user && req.user !== null){ return next() } else { res.send(401

Categories : Javascript

ExpressJS App.use Sequence of Routes
In general Express uses middleware connect architecture. Every middleware accepts next function which if is called passes the flow to the next middleware. So, in theory if you miss it you could archive what you want: app.use(function(req, res, next) { // check if the route matches amazon file if(...amazon file...) { // serve image } else { next(); } }); app.use(express.static(path.join(__dirname, 'public')));

Categories : Node Js

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

supporting multi-tenant routes in mvc
You can use the library defined here. This lib allows you to define an alternative route, if the routes conflict. You must define the routes as follows: var firstRoute = routes.MapReplaceableRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }); var secoundRoute = routes.MapRoute( name: "Tenant", url: "{tenant}/{controller}/{action}/{id}", defaults: new { tenant = "", controller = "Home", action = "Index", id = UrlParameter.Optional }, lookupParameters: new string[] {"tenant"}, lookupService: new LookupService()); firstRoute.AlternativeRoute = secondRoute; For lookupService, you just need an empty implementation of the

Categories : Asp Net Mvc

Not able to multi delete, Is this correct syntax in routes.rb for collection?
You've shown in your question that you're using submit_tag which would mean that you have a form. Your form should set the method to delete and the action to the destroy_multiple path in order to get routed to the correct action. In code that would be something like = form_tag '/profiles/destroy_multiple', method: :delete do

Categories : Ruby On Rails

Issue in following expressjs statement, picked from Expressjs.com
I can figure out the following use case of the above statement. var user= {}; user.load = function(req, res, next){ console.log(req.params.id); next(); } app.get('/user/:id', user.load, function(req, res){ // ... res.render('home'); }); You are right, it would take the declaration of the object user but then it gives you to define additional callback functions, for additional validation/manipulation.

Categories : Node Js

Multi language php script
My Approach would be to do the following: Step 1: Setup a folder tree structure like this: Languages -en -lang.en.php -fr -lang.fr.php -de -lang.de.php keep making new folders with all the other languages you want to support Step 2: Create our language files, i will start with languages/en/lang.en.php <?php $lang['label'] = 'Value for this label'; $lang['firstname'] = 'First Name'; $lang['lastname'] = 'Last Name'; $lang['phone'] = 'Phone'; // ETC ?> you would repeat this for every other language, ill do fr for example languages/fr/lang.fr.php . NOTE how the labels stay the same in english <?php $lang['label'] = 'Valeur pour ce label'; $lang['firstname'] = 'Prénom'; $lang['lastname'] = 'Nom de famille'; $lang

Categories : PHP

How to use multi-language output from database?
You must query the database first like this: mysql_query("SET NAMES 'utf8'"); // use mysqli_ ! After you've run this query you can run your regular "select" etc.. Also, make sure the collation of the fields is utf8_general_ci

Categories : PHP

Multi language software to run on two platforms
That may refer to Font. make sure you have fonts available in windows. This is a link to a unicode to un-unicode converter. it may be useful

Categories : Java

JSF 2 - Multi language support issue
You have to use <f:view/> tag with its locale attribute, which should be bound to a SessionScoped bean variable (or another scope, if you want only an specific part of your application to be in a different language). That will render the current view based in that locale value.

Categories : JSF

Yii multi-language folder structure
See the documentation. You can put it anywhere that suits you, and in the app config file, you can set the path where the messages component will look for message files: <?php return array( // ... 'messages' => array( 'basePath' => __DIR__ . '/../../messages', ), // ... );

Categories : PHP

Lightweight, multi-language and bidirectional RPC
If java and python language support is sufficient, one alternative you might consider is Versile (full disclosure: I am one of the developers). Supports bi-directional object interaction. That is also how you would implement "registering to events", by providing an object to a peer for event callbacks. Best source of more info is Versile Python documentation overview and examples.

Categories : Java

SQLite database with multi language iOS 6 app
(I assume its not same app with different binaries for different app stores). I saw somewhere but not able to recollect that there was an unofficial limit of three copies of the same app for localisation reasons.Since Apple released the App Store Review Guidelines, one of them is that developers should not "spam" the app store with multiple versions of the same app with minor changes. Why don't you merge all your apps(languages) into one and keep it in your server.So that the end-user can download any version(language) of the content they want,and even it will be easier for you to keep your database upto date.

Categories : Iphone

Multi Language Design support in IOS
As Mike Weller mentioned in his comment, Autolayout should do this: https://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/AutolayoutPG/Articles/Introduction.html#//apple_ref/doc/uid/TP40010853-CH1-SW1 "You don’t even have to specify new layout for languages like Hebrew and Arabic in which the left to right ordering of elements themselves should generally be reversed." This question seems to have been answered a couple of time before, including here: Right to left and left to right languages in the same app? and here for determining which direction the language should be: iOS: Determine if device language is Right to Left (RTL)

Categories : IOS

How to create a multi-language app with XML in Android?
You need to have different strings.xml to support different langauges. http://developer.android.com/training/basics/supporting-devices/languages.html What is the list of supported languages/locales on Android?. I don't think there is support for persian language. Example: MyProject/ res/ values/ strings.xml values-es/ strings.xml values-fr/ strings.xml values-ar/ // for arabic strings.xml For spanish <?xml version="1.0" encoding="utf-8"?> <resources> <string name="title">Mi Aplicación</string> <string name="hello_world">Hola Mundo!</string> </resources> At runtime, the Android system uses the appropriate set of string resources based on the locale currently set for the u

Categories : Android

Way to create a multi language inputfield
First of all try by adding <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> If that does not work, check default collaction in database and table. I'm always using utf8_general_ci when I have to work with translations and that work for me

Categories : Javascript

wordpress multi language with arabic and spanish
You can use Codex for this purpose. It has support for many languages. http://codex.wordpress.org/WordPress_in_Your_Language http://wordpress.org/plugins/wp-multilingual/

Categories : Wordpress

Flex Multi-Language App with Hebrew and Romana
Capabilities.languages returns an array of languages in the preferred order. So if you do this: var prefLang : String; var langs : Array = Capabilities.languages; Then check if it is there: if(langs) { // your preferred language is the first one prefLang = langs[0]; } else { prefLang = Capabilities.language; }

Categories : Android

multi-language in metadata itunes connect
There is no support for Arabic on the App Store. (You can see all available iTunes languages at http://smoothlocalize.com in the "Choose Language" section) While you can set your In-app text to Arabic, you cannot set your iTunes text for Arabic. I assume they will support this in the future, but as of today it is not possible.

Categories : Iphone

What is the best way (performance) to make multi-language (Localization ) in mvc 4?
In terms of performance it's difficult to beat using resource files (.resx) as these are effectively XML files on the server - you don't have round trips to the database to fetch the localisation text. The system uses keys with associated text values, and separate resx files for each supported locale. In order to consume these strings you would use a strongly typed class like this- <h1>@WebResources.Page_Title_String</h1> <p>@WebResources.Intro_Paragraph</p> This makes it easy to send your site for translation into different languages as all the strings are in one place and there are plenty of tools available to work with the files inside and outside of Visual Studio. It is even possible to translate the file using Bing to give your translator a head start. A

Categories : Asp Net

Working on a multi-language (C++/JavaScript) project in eclipse
The best way to go here is to create two separate projects. When you create the c++ project, you can simply add the javascript project as a referred project. This way you can exchange resources.

Categories : Javascript

Multi Language insertion in SQL Server using a stored procedure
Here is the correct update statement: update tblTest set Description_Ta = @Description_Ta where Row_Id = @Row_Id; You don't need single quotes around a variable. But, I think the posting is confused. To call the procedure use: exec [dbo].[spr_Sam] 2, N'பெண்டிரேம்'; To modify it: ALTER PROCEDURE [dbo].[spr_Sam] @Row_Id int = NULL, @Description_Ta nvarchar(MAX) = null AS BEGIN update tblTest set Description_Ta = @Description_Ta where Row_Id = @Row_Id; END; You shouldn't have arguments when you define the stored procedure.

Categories : C#

Entering multi language text in a html page
There is a way out for this by changing browser settings... You can set your browser language and can accept required input language from keyboard... however this will be too limited... you can accept only those which browser... and this implementation will be browser specific... Please refer this link for further information. i do not think there is way for this in the programming... either in java script (or) in HTML

Categories : HTML

Pre-process MVC Razor File For Multi-Lingual Language Strings?
I'd suggest caching language strings on the application basis rather than fetching them for every request. For example, this can be done by maintaining a static dictionary and invalidating the cache only when the user makes changes to these strings. This will make your application more responsive as well as save you from implementing (imho) rather more complex and not necessarily efficient technique of loading this data on-demand. As a side note I'd add the following: it's usually a good practice to address these kinds of problems when they arise (rather than fixing something that is not broken) and focus on more important things. I totally agree that performance implications of a given solution must always be taken into consideration, I'm just saying that premature optimizations are not

Categories : C#

How to set multi-language name to a db field in validation error message on laravel4
There are two ways to provide custom field names for the validation error messages. First is using the language config file app/lang/LANG/validation.php /* |-------------------------------------------------------------------------- | Custom Validation Attributes |-------------------------------------------------------------------------- | | The following language lines are used to swap attribute place-holders | with something more reader friendly such as E-Mail Address instead | of "email". This simply helps us make messages a little cleaner. | */ 'attributes' => array('foo' => 'Bar'), This will generate validation errors for foo field such "The Bar must be..." instead of "The foo must be ...". The second way is not documented. You can provide the custom array on runtime using

Categories : PHP

Endless Redirect Loop by htaccess rules multi language
This is the line that is causing the redirect loop: RewriteRule ^(en|de)/(.*)$ $2?lang=$1&%{query_STRING} [R=301,L] Because it is redirecting the browser to /?lang=en (for example). Then the first rule: RewriteRule ^$ en/ [R=301,L] Redirects it to /en/?lang=en, then the last rule redirects it to /?lang=en, then the first rule, etc. You probably meant the last rule to be internal, additionally, your first rule needs to check if there's already a query string parameter, "lang": RewriteEngine On RewriteBase / # empty url -> redirect to en/ RewriteCond %{QUERY_STRING} !lang=(en|de) RewriteRule ^$ en/ [R=301,L] # url is ONLY '/en' or '/de' -> redirect to /en/ or /de/ (adding slash) RewriteRule ^(en|de)$ $1/ [R=301,L] # now all urls have en/ de/ -> parse them Rewrite

Categories : Htaccess

Multi language settings and getting string array item - android
Okay I got your solution: First of all: String celcius = sharedPrefs.getString("prefTempUnit", "Celcius") will return "Celcius" as a default value. Maybe you should remove it? Second: If you would like to access the String value according to the actual language, you should use: String retrievedValueFromStringXML = getResources().getString(R.string.celcius); To add: ListPreference has a method called getValue(), you should use it as well to retrieve the actual value.

Categories : Android

Is this the right way to structure MVC (understanding gathered from teresko's posts) + incorporating multi-language support into the framework?
This really isn't all that related to MVC. When you are implementing multilingual URLs, it's all about routing. Routing Basically, by the time your code gets to calling stuff on controller, you should have fully initialized request instance, that has recognized language from the URL and translated all the parts of input into something useful for creating instances. $request = new Request($query); $router = new Router; $router->import('/path/to/routes.json'); $router->route( $request ); At this point you would have split the user's query (from example: '/presentation/view/dernières/nouvelles') into recognized segments, based on pattern that was recognized. Lets take for example, that matted pattern was in config defined as: /presentation[[/:action[/:filter]]/:resource

Categories : PHP

how to use shared preference on multi textview,multi checkbox,multi button and multi edit box in android?
Use these method to save and get values from any where in your app change parameter according to your requirment this method to save value in shared prefrences public static void setPref(Context c, String pref, String val) { Editor e = PreferenceManager.getDefaultSharedPreferences(c).edit(); e.putString(pref, val); e.commit(); } this method to get value from shared prefrences public static String getPref(Context c, String pref, String val) { return PreferenceManager.getDefaultSharedPreferences(c).getString(pref, val); }

Categories : Android

Best way to use word lists for multi-language word game
It depends on number of words and your app's logic of retrieving data. If the number of words is not that large, you could use plist file. As for sqlite, while building your logic, you have take into account that you can not retrieve data from the database concurrently, e.g can't request data at the same time from different threads.

Categories : IOS

How to leave my general "Routes" intact when operating code in a specific "Area" with its own "Routes"?
When you have areas in your app you will need to be specific about which controllers and actions you want to point to. If you are inside your SubApp area, then any link you need to create pointing to the root, should include an empty area. @Url.Action("index", "home", new { area = "" } Using the same concept, any url from the root controllers to the SubApp area should include the area in the link: @Url.Action("index", "home", new { area = "SubApp" } If you are not crossing any boundaries, then not specifying the area will default to the area you are in.

Categories : Asp Net Mvc

Iteration Through Routes Mapped to RouteTable.Routes via MapHttpRoute - MVC4 Web API
If you are looking to iterate only through Web API route collection, you could do something like GlobalConfiguration.Configuration.Routes to get HttpRouteCollection. This collection would have all your api routes.

Categories : Asp Net

Rails Routes. Multiple nested routes with member actions
Delete the comma between resources :milestones and resources :comments. Your code should be resources :projects do resources :milestones resources :comments do member {post :hide} end end

Categories : Ruby On Rails

How to enable format in routes with ServiceStack in tandem with custom routes?
See the wiki page on Routing for documentation on how Routing works, e.g. if you wanted to use pre-defined routes the correct urls would be: /api/json/reply/Things /api/json/reply/things?Id=1 /api/xml/reply/Things /api/xml/reply/things?Id=1 Note: the pre-defined only uses the name of the Request DTO, i.e. it does not use all your custom routes. The Content Negotiation section on Routing wiki shows the different ways to request different Content-Types. In ServiceStack (v3.9.54+) you can now use a format .ext e.g: /api/things.json /api/things/1.json /api/things.xml /api/things/1.xml Which is an alternative to using the ?format=ext parameter: /api/things?format=json /api/things/1?format=json /api/things?format=xml /api/things/1?format=xml

Categories : Rest

Rails 2 + Spree 0.11.0: How do routes work when there are so many routes files?
Routes should be specified in config/routes.rb Here's where they're specified in Spree 0.11.0: https://github.com/spree/spree/blob/v0.11.0/config/routes.rb Modern versions of Spree are mountable Rails engines which will mount some of its own routes underneath your applications routes. However, you're dealing with the rails 2 version which injects its routes a little differently. You're dealing with a very old version of Spree, so many of the resources you find on the internet will pertain to more modern versions of Spree (Rails 3.0+). Your easiest bet will be to figure out where 'gourmet-specialties' is coming from and remove it. If it's coming from the taxonomy tree, try recategorizing it under the root taxon.

Categories : Ruby On Rails

Multi Client Server, Multi interface, Multi IP version Socket
You're not missing anything. It is accepting connections to ::1 you said? Then it will accept ipv6 connections. And since IPv6 is backwards compatible, if you've created the correct ipv6 socket, it should be able to send and receive ipv4 packets as well.

Categories : C

How to build specific resource routes in routes.rb
You can specify which of the standard routes to include when you use the resources command, with the except and only options: resources :foo, :except => [:destroy] do end or resources :foo, :only => [:index, :create, :show] do end

Categories : Ruby On Rails

Matching routes in config/routes.rb to a controller
You should use a named route, it would be easier: routes.rb: post 'polls/toggle_live' => 'polls#toggle_live', :as => 'toggle_live' In the view: = link_to "Start", toggle_live_path, {:method => :post, :remote=>true}, {:class=> 'btn btn-success btn-small start-poll'}

Categories : Ruby On Rails

Ember Routes and Rails Routes
How does the browser know to look for an Ember route when the route does not exist in rails? It doesn't. When you enter a url in browser, it will make request to the server, then rails should respond with some content. So in this case when the "/newslinks" url is requested you want rails to respond with an HTML page that includes your ember application. When that page is loaded, the ember app will boot up and from there the ember-router will be used to handle links within the context of your ember app. Make sense?

Categories : Ruby On Rails

Rails routes: same controller different routes
You can use route with constraints. Define a class that executes matches with customized conditions. You can search the API with match to see details. I assume that your tag has two columns named "category" and "name". route.rb match ':category/:name' => 'tags#show', via: 'get', constraints: TagRouteWhiteList.new, as: 'tag' app/models/tag_route_white_list.rb class TagRouteWhiteList def matches(request) Tag.distinct('category').include?(request.params[:category]) && Tag.distinct('name').include?(request.params[:name]) end end In your view, you can use tag_path(category: @tag.category, name: @tag.name)

Categories : Ruby On Rails



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