Commit 798dc09f authored by Fabio Bas's avatar Fabio Bas
Browse files

Translation updates to support Transifex

 * ignore .tx folder
 * cmake: when UPDATE_TRANSLATIONS=ON, extract new strings only to the
english translation file.
 * added info in CONTRIBUTING.md
 * updated english translations
parent 12fe0f53
......@@ -5,3 +5,4 @@ build*
mysql.cnf
.DS_Store
.idea/
.tx/
......@@ -132,3 +132,59 @@ mutating objects.)
When pointers can't be avoided, try to use a smart pointer of some sort, such
as `QScopedPointer`, or, less preferably, `QSharedPointer`.
### Translations (for developers) ###
All the user-interface strings inside cockatrice's source code must be written in
english language. Translations to other languages are managed using Transifex:
http://www.transifex.com
If you're about to propose a change that adds or modifies any translatable string
in the code, you'll need to update the basic translation files so that translators
are notified that new strings needs to be translated.
To update the basic translation files, re-run cmake with enabling the appropriate
parameter and then run make:
cd cockatrice/build
cmake .. -DUPDATE_TRANSLATIONS=ON
make
If the parameter has been enabled correctly, when running "make" you should see
a line similar to this one (the numbers may vary):
[ 76%] Generating ../../cockatrice/translations/cockatrice_en.ts
Updating '../../cockatrice/translations/cockatrice_en.ts'...
Found 857 source text(s) (8 new and 849 already existing)
You should then notice that the following files have uncommitted changes:
cockatrice/translations/cockatrice_en.ts
oracle/translations/oracle_en.ts
It's now suggested to disable the parameter using:
cmake .. -DUPDATE_TRANSLATIONS=OFF
Now you are ready to propose your change. Once your change gets merged,
Transifex will pick up the modified files automatically (checks every 24 hours)
and update the interface where translators will be able to translate the new
strings.
### Translations (for mantainers) ###
Before rushing out a new release, it would be nice to fetch the most up to date
translations from Transifer and commit them in the cockatrice source code.
This can be done manually from the Transifex we interface, but it's quite time
expensive.
As an alternative, you can install the Transifex CLI:
http://docs.transifex.com/developer/client/
You'll then be able to use a git-like cli command to push and pull translations
from Transifex to the source code and viceversa.
### Translations (for translators) ###
Please have a look at the specific FAQ:
https://github.com/Cockatrice/Cockatrice/wiki/Translation-FAQ
\ No newline at end of file
......@@ -98,12 +98,14 @@ if (UNIX AND NOT APPLE)
endif (UNIX AND NOT APPLE)
set(cockatrice_RESOURCES cockatrice.qrc)
FILE(GLOB cockatrice_TS "${CMAKE_CURRENT_SOURCE_DIR}/translations/*.ts")
IF(UPDATE_TRANSLATIONS)
FILE(GLOB_RECURSE translate_cockatrice_SRCS ${CMAKE_SOURCE_DIR}/cockatrice/src/*.cpp ${CMAKE_SOURCE_DIR}/cockatrice/src/*.h)
FILE(GLOB_RECURSE translate_common_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/common/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/common/*.h)
SET(translate_SRCS ${translate_cockatrice_SRCS} ${translate_common_SRCS})
SET(cockatrice_TS "${CMAKE_CURRENT_SOURCE_DIR}/translations/cockatrice_en.ts")
ELSE()
FILE(GLOB cockatrice_TS "${CMAKE_CURRENT_SOURCE_DIR}/translations/*.ts")
ENDIF(UPDATE_TRANSLATIONS)
if(WIN32)
......
This diff is collapsed.
......@@ -23,11 +23,13 @@ if (UNIX AND NOT APPLE)
endif (UNIX AND NOT APPLE)
set(oracle_RESOURCES oracle.qrc)
FILE(GLOB oracle_TS "${CMAKE_CURRENT_SOURCE_DIR}/translations/*.ts")
IF(UPDATE_TRANSLATIONS)
FILE(GLOB_RECURSE translate_oracle_SRCS ${CMAKE_SOURCE_DIR}/oracle/src/*.cpp ${CMAKE_SOURCE_DIR}/oracle/src/*.h)
SET(translate_SRCS ${translate_oracle_SRCS})
SET(oracle_TS "${CMAKE_CURRENT_SOURCE_DIR}/translations/oracle_en.ts")
ELSE()
FILE(GLOB oracle_TS "${CMAKE_CURRENT_SOURCE_DIR}/translations/*.ts")
ENDIF(UPDATE_TRANSLATIONS)
if(WIN32)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment