Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converted translation system to Gettext #31

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a1eba63
Fixed index in portuguese translation.
gunchleoc Nov 11, 2015
0dca37e
Added ISO codes to locales conf file.
gunchleoc Nov 11, 2015
8294c17
Created po files from old translations.
gunchleoc Nov 11, 2015
3e3c940
Added gettext functions.
gunchleoc Nov 12, 2015
f9eadfd
String markup: Replaced locales::getLocale with new gettext macro.
gunchleoc Nov 12, 2015
46c6f46
Added script to build translation reference catalog.
gunchleoc Nov 13, 2015
2e16502
Added scripts to build languages' translation catalogs and binaries
gunchleoc Nov 14, 2015
84fc1ce
Replaced defunct placeholder macros with sprintf.
gunchleoc Nov 14, 2015
b1d8271
Strings are now loaded from gettext, but locale selection and encodin…
gunchleoc Nov 14, 2015
f8addc5
Look for locales.conf instead of English.txt
gunchleoc Nov 14, 2015
19cff16
Fixed encoding issues. Locale selection is still broken.
gunchleoc Nov 14, 2015
5c0717e
Cleaned up strings and fixed translations.
gunchleoc Nov 14, 2015
ecff3b7
Added some comments.
gunchleoc Nov 15, 2015
7cc63b6
Fixed locale loading.
gunchleoc Nov 15, 2015
de9cf0e
Fixed language switching for all menus except for the Options menu.
gunchleoc Nov 15, 2015
5136f16
Fixed language switching for Options menu.
gunchleoc Nov 15, 2015
2130299
Initialize with system locale on first run.
gunchleoc Nov 15, 2015
501c554
Small code tweak.
gunchleoc Nov 15, 2015
72d255d
Some fixes for Windows.
Nov 18, 2015
bea4dbc
Added instruction to build translation binaries to CMakeLists.txt
gunchleoc Nov 19, 2015
29f5482
use intptr_t instead of long
TinoM Nov 20, 2015
29e07e6
building with mingw32_64
TinoM Nov 22, 2015
e146634
Added translation binaries.
gunchleoc Nov 22, 2015
43b7f78
Linux doesn't need libintl, so CMake doesn't like.
gunchleoc Nov 22, 2015
93823e9
Fixed problems with temporary char*.
gunchleoc Nov 23, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ include_directories(${OPENGL_INCLUDE_DIR})
# find the sfml2 headers and library
find_package(SFML REQUIRED audio graphics)


find_package(Gettext REQUIRED)

# libintl is not used on all systems, so only include it when we actually
# found it.
if(INTL_FOUND)
find_package(INTL REQUIRED)
include_directories(${INTL_INCLUDE_DIR})
endif()

# Foundation library needed for apple
if(APPLE)
find_library(FOUNDATION_LIBRARY Foundation)
Expand Down Expand Up @@ -68,7 +78,12 @@ include_directories(${MARS_SOURCE_DIR}/include)
# compile source
add_subdirectory(src)
set(CMAKE_CXX_FLAGS "-s" CACHE STRING "CXX flags")


# Update translations and build translation binaries
#add_custom_target(_build_translation_binaries ALL
# COMMAND ${MARS_SOURCE_DIR}/utils/update_translations.sh
#)

#####################################################################
# Create package
#####################################################################
Expand Down
51 changes: 51 additions & 0 deletions cmake/modules/Findintl.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Locate intl library
# This module defines
# INTL_LIBRARY, the name of the library to link against
# INTL_FOUND, if false, do not try to link to intl
# INTL_INCLUDE_DIR, where to find libintl.h
#
# $INTLDIR is an environment variable that would
# correspond to the ./configure --prefix=$INTLDIR
# used in building libintl.
#
# Created by Eric Wing. This was influenced by the FindSDL.cmake
# module, but with modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).

FIND_PATH(INTL_INCLUDE_DIR libintl.h
HINTS
$ENV{INTLDIR}
$ENV{INTLDIR}
PATH_SUFFIXES include
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
/usr/include
/sw/include
/opt/local/include
/opt/csw/include
/opt/include
)

FIND_LIBRARY(INTL_LIBRARY
NAMES intl
HINTS
$ENV{INTLDIR}
PATH_SUFFIXES lib64 lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw
/opt/local
/opt/csw
/opt
)

SET(INTL_FOUND "NO")
IF(INTL_LIBRARY AND INTL_INCLUDE_DIR)
SET(INTL_FOUND "YES")
ENDIF(INTL_LIBRARY AND INTL_INCLUDE_DIR)

288 changes: 0 additions & 288 deletions data/locales/Arabic.txt

This file was deleted.

Loading