これはローカリゼーションの最初の試みであり、私はもっと混乱していくにつれてそれについて読むことが多くなります。正直言って、私はちょうどこの時点で答えを探しています。だから私が得ているエラーは次のとおりです。resxファイルを使用したローカリゼーションでMissingManifestResourceExceptionが生成される
未処理の例外:System.Resources.MissingManifestResourceException:指定されたカルチャまたは中立文化に適したリソースが見つかりませんでした。コンパイル時に "MeetnGreetSf.Resources.AppResources.resources"が正しく埋め込まれているか、またはアセンブリ "MeetnGreetSf"にリンクされていること、または必要なすべてのサテライトアセンブリがロード可能で完全に署名されていることを確認してください。
を発生し、ここでのクラスです:私は、私はそれがファイルの代わりの.resxへの.resourcesを追加され、いくつかの理由のために近いと思う
public class TranslateHelper
{
readonly CultureInfo ci;
private string ResourceId = "MeetnGreetSf.Resources.AppResources";
private ResourceManager resmgr;
private CultureInfo cui = new CultureInfo("es-ES");
public TranslateHelper()
{
//ResourceId += "." + cui.Name;
resmgr = new ResourceManager(ResourceId, typeof(AppResource).GetTypeInfo().Assembly);
}
public string Translate(string Name)
{
var translation = resmgr.GetString(Name, ci);
return translation;
}
}
?
ご協力いただきありがとうございます。
翻訳クラスの使用方法は含まれません。
public Colors()
{
colorInfo = new ObservableCollection<ColorType>();
t = new TranslateHelper();
this.GenerateColors();
}
private void GenerateColors()
{
colorInfo.Add(new ColorType(t.Translate("Aqua"), Color.Aqua));
colorInfo.Add(new ColorType(t.Translate("Black"), Color.Black));
colorInfo.Add(new ColorType(t.Translate("Blue"), Color.Blue));
colorInfo.Add(new ColorType(t.Translate("Gray"), Color.Gray));
colorInfo.Add(new ColorType(t.Translate("Green"), Color.Green));
colorInfo.Add(new ColorType(t.Translate("Lime"), Color.Lime));
colorInfo.Add(new ColorType(t.Translate("Maroon"), Color.Maroon));
colorInfo.Add(new ColorType(t.Translate("Navy"), Color.Navy));
colorInfo.Add(new ColorType(t.Translate("Olive"), Color.Olive));
colorInfo.Add(new ColorType(t.Translate("Purple"), Color.Purple));
colorInfo.Add(new ColorType(t.Translate("Red"), Color.Red));
colorInfo.Add(new ColorType(t.Translate("Silver"), Color.Silver));
colorInfo.Add(new ColorType(t.Translate("Teal"), Color.Teal));
colorInfo.Add(new ColorType(t.Translate("White"), Color.White));
colorInfo.Add(new ColorType(t.Translate("Yellow"), Color.Yellow));
}
}
いくつかのことを明確にしてくれてありがとうございました。これはxamarin.formsプロジェクトに縛られていて、ローカライゼーションの例を変更してコンバーターを使用することで、このアプローチを廃止しました。 – Chris