M
mastermirko
Hello,
I need help please,is 3 days that I think how do this code(I'm sorry
for my english not perfectly)...
I need an application multilanguage, I do all passage that describe
MSDN :
I write 2 files :
strings.txt
label=etichetta italiano
and strings.en.txt
label=english label
I save this file strings.txt on principal directory and sstrings.en.txt
on directory call en.
I compile this file with resgen and it create strings.resources and
strings.en.resources on respective directory.
I use VS 2005.
After I execute the command al from prompt msdos :
"al /t:lib /embed:strings.resources /outrovaSatelliteAssembly.dll"
and "al /t:lib /culture:en /embed:strings.en.resources
/outrovaSatelliteAssembly.dll"
I add the file dll to my application project.
This is my principal class Form1:
public partial class Form1 : Form
{
static ResourceManager rm = new
ResourceManager("ProvaSatelliteAssembly.strings",
Assembly.GetExecutingAssembly());
CultureInfo ci = new CultureInfo(CultureInfo.CurrentUICulture.Name);
public Form1()
{
InitializeComponent();
label1.Text = rm.GetString("LABEL",ci);
}
private void button4_Click(object sender, EventArgs e)
{
ci = new CultureInfo("en");
label1.Text = rm.GetString("LABEL", ci);
this.Refresh();
}
}
The application compile , but when I click button4, it doesn't load the
specific language culture.
It load always the language default (strings.resources).
Where is my error???
Thanks for all people that answer my question.
Mirko...
I need help please,is 3 days that I think how do this code(I'm sorry
for my english not perfectly)...
I need an application multilanguage, I do all passage that describe
MSDN :
I write 2 files :
strings.txt
label=etichetta italiano
and strings.en.txt
label=english label
I save this file strings.txt on principal directory and sstrings.en.txt
on directory call en.
I compile this file with resgen and it create strings.resources and
strings.en.resources on respective directory.
I use VS 2005.
After I execute the command al from prompt msdos :
"al /t:lib /embed:strings.resources /outrovaSatelliteAssembly.dll"
and "al /t:lib /culture:en /embed:strings.en.resources
/outrovaSatelliteAssembly.dll"
I add the file dll to my application project.
This is my principal class Form1:
public partial class Form1 : Form
{
static ResourceManager rm = new
ResourceManager("ProvaSatelliteAssembly.strings",
Assembly.GetExecutingAssembly());
CultureInfo ci = new CultureInfo(CultureInfo.CurrentUICulture.Name);
public Form1()
{
InitializeComponent();
label1.Text = rm.GetString("LABEL",ci);
}
private void button4_Click(object sender, EventArgs e)
{
ci = new CultureInfo("en");
label1.Text = rm.GetString("LABEL", ci);
this.Refresh();
}
}
The application compile , but when I click button4, it doesn't load the
specific language culture.
It load always the language default (strings.resources).
Where is my error???
Thanks for all people that answer my question.
Mirko...