Bug 16964 - Resources.GetIdentifier Returns 0 when Language setting is turkish
Summary: Resources.GetIdentifier Returns 0 when Language setting is turkish
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 4.12.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
Depends on:
Reported: 2013-12-25 05:42 UTC by ba
Modified: 2014-03-26 08:11 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description ba 2013-12-25 05:42:32 UTC

the line below Shows how I use the Getidientifier:

int l_imgResId = Resources.GetIdentifier(l_strImg, "raw", this.PackageName);

This works with all common language Settings in Android (German, English, French). But when I use it with Turkish language settings I always get 0 as reeult.
Comment 1 ba 2013-12-25 07:27:48 UTC
Hello again,

did some tests and solved it:

The string strImg has a value i.e.: strImg = "IMG_00001";
I did l_strImg.ToLower() before calling:
int l_imgResId = Resources.GetIdentifier(l_strImg, "raw", this.PackageName);

.ToLower makes in turkish language:

ımg_00001 instead of img00001
Please look at the strings twice :-) especially on the first letter 'i'

Hard to debug... but the GetIdentifier function works correct.
Comment 2 Tajinder Singh 2014-03-26 08:11:33 UTC
As per comment 1, this issue is solved.

Hence closing this issue.