Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Translation files
Re: Translation files [message #54968 is a reply to message #54965] Fri, 02 October 2020 12:04 Go to previous messageGo to next message
idkfa46 is currently offline  idkfa46
Messages: 155
Registered: December 2011
Experienced Member
Ciao Mirek,
thank your for your feedback. I try to better explaining the situation...


1 - At the moment I have a database that contain text in a t_() macro and at the first run the database is create with the user language
2 - If the user change the language setting and restart the tool all the software change language making exception for the database text
3 - At this stage I have a few queries like this one that fails because the match "s" = "CATEGORIA" doesn't work (it's a different language!)

double Impostazioni::GetPsi0j(String s)
{
	SQL * Select(PSI0j).From(COEFCOMBIN).Where(CATEGORIA == s);	return SQL[PSI0j];
}


4 - To solve it I have to update the text translation in the database... To reset de database to default setting is the easiest way but I gonna lose possible user settings!

My question:

Is there a trick to force database translation update?
I have to read and update it row by row? In that case is it possible to read the database text with a Select * and Update the translation without going throught the T_("") language with something like this?

try
{
	SQL * Select(CATEGORIA).From(COEFCOMBIN);
		
	while(SQL.Fetch())
	{			
		SQL & ::Update(COEFCOMBIN)(CATEGORIA, t_(SQL[CATEGORIA])).Where(CATEGORIA == SQL[CATEGORIA]);		
	}	
}


Thanks,
Matteo
Re: Translation files [message #54978 is a reply to message #54968] Sat, 03 October 2020 04:38 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
idkfa46 wrote on Fri, 02 October 2020 12:04
Ciao Mirek,
thank your for your feedback. I try to better explaining the situation...


1 - At the moment I have a database that contain text in a t_() macro and at the first run the database is create with the user language


I guess you might got this a bit wrong, perhaps you see a magic in t_ that is not there.. All that t_ does is that it might return different string literal. So your database contains texts, period.

Quote:

Is there a trick to force database translation update?
I have to read and update it row by row? In that case is it possible to read the database text with a Select * and Update the translation without going throught the T_("") language with something like this?


Basically, yes.

Maybe you can delete the whole table content and insert new values?

All that said, this design, depending on translation, feels pretty awful. What about defining some integer constants instead of texts?

Alternatively, what about having these texts in DB in english and do the eventual translation in the application?

Mirek
Re: Translation files [message #55051 is a reply to message #54978] Wed, 07 October 2020 13:35 Go to previous message
idkfa46 is currently offline  idkfa46
Messages: 155
Registered: December 2011
Experienced Member
In the end I go to reset the whole database at the language change... I'm implementing and old project not structured for multilanguage and the db changes impacts everywhere... Laughing

Thanks,
Matteo
Previous Topic: Simple Thread
Next Topic: Create exe from Windows to Linux
Goto Forum:
  


Current Time: Sat Apr 20 06:44:18 CEST 2024

Total time taken to generate the page: 4.93986 seconds