WordPress database error: [INSERT, UPDATE command denied to user '51213-2'@'10.10.20.12' for table 'wp_options']
INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`) VALUES ('_transient_doing_cron', '1715080039.6374790668487548828125', 'yes') ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)


Warning: Cannot modify header information - headers already sent by (output started at /home/lexiqued/www/WordPress/wp-includes/wp-db.php:1502) in /home/lexiqued/www/WordPress/wp-includes/rest-api/class-wp-rest-server.php on line 1372

Warning: Cannot modify header information - headers already sent by (output started at /home/lexiqued/www/WordPress/wp-includes/wp-db.php:1502) in /home/lexiqued/www/WordPress/wp-includes/rest-api/class-wp-rest-server.php on line 1372

Warning: Cannot modify header information - headers already sent by (output started at /home/lexiqued/www/WordPress/wp-includes/wp-db.php:1502) in /home/lexiqued/www/WordPress/wp-includes/rest-api/class-wp-rest-server.php on line 1372

Warning: Cannot modify header information - headers already sent by (output started at /home/lexiqued/www/WordPress/wp-includes/wp-db.php:1502) in /home/lexiqued/www/WordPress/wp-includes/rest-api/class-wp-rest-server.php on line 1372

Warning: Cannot modify header information - headers already sent by (output started at /home/lexiqued/www/WordPress/wp-includes/wp-db.php:1502) in /home/lexiqued/www/WordPress/wp-includes/rest-api/class-wp-rest-server.php on line 1372

Warning: Cannot modify header information - headers already sent by (output started at /home/lexiqued/www/WordPress/wp-includes/wp-db.php:1502) in /home/lexiqued/www/WordPress/wp-includes/rest-api/class-wp-rest-server.php on line 1372

Warning: Cannot modify header information - headers already sent by (output started at /home/lexiqued/www/WordPress/wp-includes/wp-db.php:1502) in /home/lexiqued/www/WordPress/wp-includes/rest-api/class-wp-rest-server.php on line 1372

Warning: Cannot modify header information - headers already sent by (output started at /home/lexiqued/www/WordPress/wp-includes/wp-db.php:1502) in /home/lexiqued/www/WordPress/wp-includes/rest-api/class-wp-rest-server.php on line 1372
{"id":1445,"date":"2013-06-05T18:25:41","date_gmt":"2013-06-05T16:25:41","guid":{"rendered":"http:\/\/www.jonathanantoine.com\/?p=1445"},"modified":"2013-06-05T18:41:10","modified_gmt":"2013-06-05T16:41:10","slug":"winrt-how-to-get-the-resolved-resource-language-code","status":"publish","type":"post","link":"http:\/\/www.jonathanantoine.com\/2013\/06\/05\/winrt-how-to-get-the-resolved-resource-language-code\/","title":{"rendered":"[WinRT] How to get the language code actually used to resolve a resource"},"content":{"rendered":"

I am working on an app with a lot of different languages. This is really great because there is a lot more chances that the user get the app in its spoken tongue. You can read more on this topic on MSDN<\/a>.<\/p>\n

Then I wanted to get a basic information : the language used by the app. Let’s say that the user is spanish and that I didn’t translate my app for this tongue then the app could be in english because it’s the one tongue matching the best its preference. The “english” won’t necessary be the first language declared in my manifest but the best one for the user. <\/p>\n

By using a ResourceLoader object<\/a>, you can get any string in the right language but I didn’t find an easy way to get the actually used language.<\/strong> <\/p>\n

By digging into the WinRT APIs, I found a way to get this information and it could help you.
\n<\/p>\n

A solution<\/h3>\n

The trick is to use the MainResourceMap of the app to retrieve a resource candidate<\/a> for a resource key I know being in all my resources files.<\/strong> With this ResourceCandidate, I can get the ResourceQualifier<\/a> which made the framework choose this resource. On this qualifier, I can then retrieve the name of the used language…<\/p>\n

[csharp]
\n\/\/I have a resource file named "Resources" for each my language
\n\/\/ and each one has a ‘AResource’ object in it.
\nvar namedResource = ResourceManager.Current.MainResourceMap
\n .FirstOrDefault(nR => nR.Key == "Resources\/AResource").Value;<\/p>\n

\/\/I resolve this resource
\nvar resourceCandidate = namedResource.Resolve();<\/p>\n

\/\/The qualifier let me know the used language code.
\nvar resourceQualifier= resourceCandidate.Qualifiers.FirstOrDefault();<\/p>\n

var languageCode = resourceQualifier.QualifierValue;
\n[\/csharp]<\/p>\n

You can also get interesting information from the resourceCandidate object :
\n<\/strong><\/p>\n