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 » Developing U++ » U++ Developers corner » TheIDE : allow single translation file in main package
TheIDE : allow single translation file in main package [message #36802] Fri, 06 July 2012 19:32 Go to previous message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Working with a big project composed of many packages, I had the problem of maintaining all translation files spread in each package; so, I made a small mod to theide that allows to have a single .t file in main package.

So, now you can do it in 3 ways :

1) Modular one, as before, a single translation file per package

2) Main package centric : if no .t files are found inside an used package, but there's one in main package, the translations are synced in the main package .t file.

3) Mixed : if an used package has a .t file, it's still used.

Resulting main package .t file example :

#ifdef _MSC_VER
#pragma setlocale("C")
#endif
// main.cpp

T_("main package string\n")
itIT("stringa nel programma principale\n")


// PACKAGE 'TestLangSlave1' FILE 'test1.cpp'

T_("first slave package test string\n")
itIT("stringa test nel primo package slave\n")

T_("same text string in both packages\n")
itIT("stessa stringa in entrambi i package\n")


// PACKAGE 'TestLangSlave2' FILE 'test1.cpp'

T_("second slave package test string\n")
itIT("stringa test nel secondo package slave\n")


As you see, the string
T_("same text string in both packages\n")


is output just once, which is the true advantage of this way of translating when you've many identical strings in different packages : just one translation to maintain, and you can be sure to have same text.

here, a third package with its own translation file, still gets its language strings there :

ifdef _MSC_VER
#pragma setlocale("C")
#endif
// pippo.cpp

T_("this is in third package, with own translation file\n")
itIT("questo è il terzo package, col suo file di traduzione\n")

T_("same text string in both packages\n")
itIT("stessa stringa in entrambi i package\n")


Ciao

Max
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: true dynamic dispatching with Upp?
Next Topic: Fixing translations
Goto Forum:
  


Current Time: Tue Apr 23 09:03:56 CEST 2024

Total time taken to generate the page: 0.01665 seconds