나는 monodroid IRC 채널에 대해 질문을하고 공식적인 답변은 "아직 지원되지하지만 우리는 그것을 할 계획이 있는가"했다. http://docs.xamarin.com/android/tutorials/Android_Resources/Part_5_-_Application_Localization_and_String_Resources
내 응용 프로그램 (게임) 나는 이름으로 지역화 된 문자열을 찾아 볼 필요에서 : 다음과 같이
당신은 (아래 참조) 프로젝트에 추가 안드로이드 XML 형식으로 RESX 파일을 변환 할 필요가 . 이렇게하는 코드는 간단하지만 즉시 명백하지는 않습니다. 대신 ResourceManager에를 사용하는 나는 안드로이드에 대한이의 교환 :
class AndroidResourcesProxy : Arands.Core.IResourcesProxy
{
Context _context;
public AndroidResourcesProxy(Context context)
{
_context = context;
}
public string GetString(string key)
{
int resId = _context.Resources.GetIdentifier(key, "string", _context.PackageName);
return _context.Resources.GetString(resId);
}
}
내가 안드로이드 문자열 XML 파일을 RESX을 변환하는 명령 줄 프로그램을 만든 XSLT 전문가가 아니에요 이후 : 안드로이드
/// <summary>
/// Conerts localisation resx string files into the android xml format
/// </summary>
class Program
{
static void Main(string[] args)
{
string inFile = args[0];
XmlDocument inDoc = new XmlDocument();
using (XmlTextReader reader = new XmlTextReader(inFile))
{
inDoc.Load(reader);
}
string outFile = Path.Combine(Path.GetDirectoryName(inFile), Path.GetFileNameWithoutExtension(inFile)) + ".xml";
XmlDocument outDoc = new XmlDocument();
outDoc.AppendChild(outDoc.CreateXmlDeclaration("1.0", "utf-8", null));
XmlElement resElem = outDoc.CreateElement("resources");
outDoc.AppendChild(resElem);
XmlNodeList stringNodes = inDoc.SelectNodes("root/data");
foreach (XmlNode n in stringNodes)
{
string key = n.Attributes["name"].Value;
string val = n.SelectSingleNode("value").InnerText;
XmlElement stringElem = outDoc.CreateElement("string");
XmlAttribute nameAttrib = outDoc.CreateAttribute("name");
nameAttrib.Value = key;
stringElem.Attributes.Append(nameAttrib);
stringElem.InnerText = val;
resElem.AppendChild(stringElem);
}
XmlWriterSettings xws = new XmlWriterSettings();
xws.Encoding = Encoding.UTF8;
xws.Indent = true;
xws.NewLineChars = "\n";
using (StreamWriter sr = new StreamWriter(outFile))
{
using (XmlWriter writer = XmlWriter.Create(sr, xws))
{
outDoc.Save(writer);
}
}
}
}
현지화 폴더 제목을 통해 구현되었습니다. 이 작업을 수행하는 방법은이 기사를 읽으십시오. http://developer.android.com/guide/topics/resources/localization.html – mironych