Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how can i localize text in videos using c# .net..i am developing a project thats purpose is to extract text from videos ..so i have to perform some steps on it first step is text localization but i dont know how to do it.
Posted
Updated 27-Aug-13 20:32pm
v2

1 solution

Ok, before considering in case of a video i would ask you a question, do you actually know what is text localization? How it works?
If not,then let's start(i assume you don't know about it).
1. Add a Resource file to your project (you can call it "strings.resx")
2. Add a string resouce in the resx file and give it a good name (example: name it "Hello" with and give it the value "Hello")
3. Save the resource file.
Now run this line of code:
C#
Console.WriteLine(strings.Hello);

It will print "Hello".
Now, add a new resource file, named "strings.fr.resx" (note the "fr" part; this one will contain resources in French). Add a string resource with the same name as in strings.resx, but with the value in French (Name="Hello", Value="Salut"). Now, if you run the following code, it should print Salut:
C#
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("fr-FR");
Console.WriteLine(strings.Hello);

Also get some good knowledge from these:
Localization in Win forms using C#[^]
Localizing a WPF program using C# [^]
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900