Move data translations to content repository
parent
d1d8bea75f
commit
a224da20d4
|
@ -1,21 +1,10 @@
|
|||
*.user
|
||||
Debug/
|
||||
Release/
|
||||
.vs/
|
||||
*~
|
||||
.deps
|
||||
*.o
|
||||
*.a
|
||||
*.la
|
||||
po*/*.gmo
|
||||
po*/POTFILES
|
||||
po*/stamp-po
|
||||
.dirstamp
|
||||
build
|
||||
build-cmake
|
||||
cmake-build
|
||||
.qmake.stash
|
||||
src/celestia/win32/res/resource_strings.cpp
|
||||
src/celestia/qt/rc.cpp
|
||||
data/*.cpp
|
||||
*.cpp
|
||||
.DS_Store
|
||||
|
|
|
@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.1.0)
|
|||
project(celestia VERSION "1.7.0" LANGUAGES NONE)
|
||||
|
||||
option(NATIVE_OSX_APP "Support native OSX paths read data from (Default: off)" OFF)
|
||||
option(ENABLE_NLS "Enable object names translation? (Default: on)" ON)
|
||||
|
||||
# Use our cmake files
|
||||
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
|
@ -10,6 +11,14 @@ list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
|||
include(GNUInstallDirs)
|
||||
include(install_to_extras_subdir)
|
||||
|
||||
if(ENABLE_NLS)
|
||||
find_package(Gettext)
|
||||
if(NOT GETTEXT_FOUND)
|
||||
message(WARNING "Gettext is not found, traslations won't be created.")
|
||||
endif()
|
||||
include(FixGettext)
|
||||
endif()
|
||||
|
||||
if(NATIVE_OSX_APP)
|
||||
set(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}/${PROJECT_NAME}.app/Contents")
|
||||
set(CMAKE_INSTALL_FULL_LOCALEDIR "${CMAKE_INSTALL_PREFIX}/Resources/locale")
|
||||
|
@ -25,5 +34,6 @@ add_subdirectory(data)
|
|||
add_subdirectory(extras)
|
||||
add_subdirectory(extras-standard)
|
||||
add_subdirectory(models)
|
||||
add_subdirectory(po)
|
||||
add_subdirectory(textures)
|
||||
add_subdirectory(warp)
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
macro(GETTEXT_CREATE_TRANSLATIONS2 _potFile _firstPoFileArg)
|
||||
# make it a real variable, so we can modify it here
|
||||
set(_firstPoFile "${_firstPoFileArg}")
|
||||
|
||||
set(_gmoFiles)
|
||||
get_filename_component(_potName ${_potFile} NAME)
|
||||
string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _potBasename ${_potName})
|
||||
get_filename_component(_absPotFile ${_potFile} ABSOLUTE)
|
||||
|
||||
set(_addToAll)
|
||||
if(${_firstPoFile} STREQUAL "ALL")
|
||||
set(_addToAll "ALL")
|
||||
set(_firstPoFile)
|
||||
endif()
|
||||
|
||||
foreach (_currentPoFile ${_firstPoFile} ${ARGN})
|
||||
get_filename_component(_absFile ${_currentPoFile} ABSOLUTE)
|
||||
get_filename_component(_abs_PATH ${_absFile} PATH)
|
||||
get_filename_component(_lang ${_absFile} NAME_WE)
|
||||
set(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)
|
||||
set(_poFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.po)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${_gmoFile}
|
||||
COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --output-file=${_poFile} --lang=${_lang} --sort-output ${_absFile} ${_absPotFile}
|
||||
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_poFile}
|
||||
DEPENDS ${_absPotFile} ${_absFile}
|
||||
)
|
||||
|
||||
if(NATIVE_OSX_APP)
|
||||
install(FILES ${_gmoFile} DESTINATION Resources/locale/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
|
||||
else()
|
||||
install(FILES ${_gmoFile} DESTINATION ${CMAKE_INSTALL_LOCALEDIR}/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
|
||||
endif()
|
||||
set(_gmoFiles ${_gmoFiles} ${_gmoFile})
|
||||
|
||||
endforeach ()
|
||||
|
||||
if(NOT TARGET translations)
|
||||
add_custom_target(translations)
|
||||
endif()
|
||||
|
||||
_GETTEXT_GET_UNIQUE_TARGET_NAME(translations uniqueTargetName)
|
||||
|
||||
add_custom_target(${uniqueTargetName} ${_addToAll} DEPENDS ${_gmoFiles})
|
||||
|
||||
add_dependencies(translations ${uniqueTargetName})
|
||||
|
||||
endmacro()
|
|
@ -1,3 +1,6 @@
|
|||
Milky Way
|
||||
LMC
|
||||
SMC
|
||||
Pleiades
|
||||
Hyades
|
||||
Praesepe
|
||||
|
@ -16,4 +19,4 @@ Fath 703
|
|||
47 Tuc
|
||||
Eridanus
|
||||
Pyxis
|
||||
Tonantzintla 2
|
||||
Tonantzintla 2
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
Sol
|
||||
Solar System Barycenter
|
||||
Sun
|
||||
Alpheratz
|
||||
Sirrah
|
||||
Caph
|
||||
|
@ -503,4 +505,4 @@ Alkarab
|
|||
Veritate
|
||||
Poerava
|
||||
Errai
|
||||
Axólotl
|
||||
Axólotl
|
||||
|
|
|
@ -3,3 +3,4 @@ usr/share/celestia/extras-standard
|
|||
usr/share/celestia/data
|
||||
usr/share/celestia/models
|
||||
usr/share/celestia/textures
|
||||
usr/share/locale
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
celestiacontent (1.7.0~git20200306+59e133f+0) UNRELEASED; urgency=medium
|
||||
celestiacontent (1.7.0~git20211202+668347e9+0) bionic; urgency=medium
|
||||
|
||||
* New snapshot build
|
||||
* Install translations for celestia-data.
|
||||
|
||||
-- Hleb Valoshka <375gnu@gmail.com> Fri, 06 Mar 2020 18:47:48 +0300
|
||||
-- Hleb Valoshka <375gnu@gmail.com> Thu, 02 Dec 2021 11:09:22 +0200
|
||||
|
||||
celestia (1.6.1+dfsg-3.1) unstable; urgency=low
|
||||
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
if((NOT ENABLE_NLS) OR (NOT GETTEXT_FOUND))
|
||||
return()
|
||||
endif()
|
||||
|
||||
file(GLOB PO_FILES "*.po")
|
||||
gettext_create_translations2("celestia-data.pot" ALL ${PO_FILES})
|
|
@ -0,0 +1,37 @@
|
|||
po_files := $(wildcard *.po)
|
||||
domain := celestia-data
|
||||
pot_file := $(domain).pot
|
||||
|
||||
all: po-update
|
||||
|
||||
$(pot_file): $(pot_file)-update
|
||||
|
||||
$(pot_file)-update: data.cpp
|
||||
xgettext --keyword=_ --keyword=i18n \
|
||||
--sort-by-file --qt --add-comments \
|
||||
--default-domain=$(domain) --package-name=celestia --package-version=1.7.0 \
|
||||
--msgid-bugs-address=team@celestia.space \
|
||||
--copyright-holder="Celestia Development Team" \
|
||||
--output=$(pot_file) \
|
||||
--from-code=utf-8 \
|
||||
data.cpp
|
||||
|
||||
data.cpp: ../data/asterisms.dat ../data/solarsys.ssc ../data/earth_locs.ssc ../data/world-capitals.ssc ../data/dwarfplanets.ssc ../data/minormoons.ssc ../data/well-known-starnames.txt ../data/well-known-dsonames.txt
|
||||
egrep '^\"' ../data/asterisms.dat | awk -F'\"' '{ print "_(\"" $$2 "\");" }' > data.cpp
|
||||
egrep '^(\"|ReferencePoint)' ../data/solarsys.ssc | awk -F'\"|:' '{ print "_(\"" $$2 "\");" }' >> data.cpp
|
||||
egrep '^(\"|ReferencePoint)' ../data/dwarfplanets.ssc | awk -F'\"|:' '{ print "_(\"" $$2 "\");" }' >> data.cpp
|
||||
egrep '^(\"|ReferencePoint)' ../data/minormoons.ssc | awk -F'\"|:' '{ print "_(\"" $$2 "\");" }' >> data.cpp
|
||||
grep \"Sol/Earth\" ../data/earth_locs.ssc | awk -F\" '{ print "_(\"" $$2 "\");" }' >> data.cpp
|
||||
grep \"Sol/Earth\" ../data/world-capitals.ssc | awk -F\" '{ print "_(\"" $$2 "\");" }' >> data.cpp
|
||||
cat ../data/well-known-starnames.txt | awk '{ print "_(\"" $$0 "\");" }' >> data.cpp
|
||||
cat ../data/well-known-dsonames.txt | awk '{ print "_(\"" $$0 "\");" }' >> data.cpp
|
||||
|
||||
po-update: $(po_files)
|
||||
|
||||
%.po: $(pot_file)
|
||||
msgmerge --update $@ $(pot_file)
|
||||
|
||||
clean: clean-data
|
||||
|
||||
clean-data:
|
||||
rm -rf data.cpp
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,19 @@
|
|||
# Sed script that remove the POT-Creation-Date line in the header entry
|
||||
# from a POT file.
|
||||
#
|
||||
# The distinction between the first and the following occurrences of the
|
||||
# pattern is achieved by looking at the hold space.
|
||||
/^"POT-Creation-Date: .*"$/{
|
||||
x
|
||||
# Test if the hold space is empty.
|
||||
s/P/P/
|
||||
ta
|
||||
# Yes it was empty. First occurrence. Remove the line.
|
||||
g
|
||||
d
|
||||
bb
|
||||
:a
|
||||
# The hold space was nonempty. Following occurrences. Do nothing.
|
||||
x
|
||||
:b
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue