public Form1() { // Setup translation data Tx.UseFileSystemWatcher = true; Tx.LoadDirectory("lang"); Tx.PrimaryCulture = "de"; InitializeComponent(); // Adopt UI font Font = SystemFonts.MessageBoxFont; // Statically set a control's text once //IntroLabel.Text = Tx.T("intro"); // Add a custom control property binding to a text key //TxDictionaryBinding.AddBinding(IntroLabel, "Text", "intro"); // Add translation dictionary bindings for all controls TxDictionaryBinding.AddTextBindings(this); // Fill the languages drop-down and select the current language string currentCulture = Tx.GetCultureName(); foreach (CultureInfo ci in Tx.AvailableCultures) { CultureLabel cl = new CultureLabel(ci.Name, Tx.U(ci.NativeName)); LanguageCombo.Items.Add(cl); if (ci.Name == currentCulture) { LanguageCombo.SelectedItem = cl; } } isLoading = false; }
protected override void OnStart() { // Configure Crash handler AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException; Application.Current.DispatcherUnhandledException += DispatcherOnUnhandledException; TaskScheduler.UnobservedTaskException += TaskSchedulerOnUnobservedTaskException; Tx.UseFileSystemWatcher = true; //Tx.LoadFromXmlFile(@"lang\languages.txd"); Tx.LoadDirectory("Languages"); }
public static void Main(string[] args) { // Enable translation Tx.LoadFromEmbeddedResource("fVis.Dictionary.txd"); #if DEBUG Tx.UseFileSystemWatcher = true; #endif string path = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); Tx.LoadDirectory(path, "fVis"); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Windows.MainWindow()); }