Skip to content

Commit

Permalink
refactor(i18n): migrate internationalization system (#1278)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nelson-numerical-software authored Nov 3, 2024
1 parent 539a1e8 commit 031c63c
Show file tree
Hide file tree
Showing 55 changed files with 5,358 additions and 16,614 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ bin/macos/*-exec
/modules/help_tools/thirdparty/highlight.js
/tools/gettext/bin
.DS_Store
*.mo
/tools/gettext/generatepo/Release
/tools/gettext/generatepo/Debug
/tools/gettext/generatepo/x64
Expand Down Expand Up @@ -220,7 +219,8 @@ module_skeleton/*/*.manifest
a.out
cmake_hdf5_test.out
################################################################################
locale/en_US/LC_MESSAGES/nelson.po
locale/nelson.pot
locale/??_??/
################################################################################
modules/main/help/*/md/lgpl-3.0.md
modules/main/help/*/md/gpl-3.0.md
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- `title`: `Visible` property is inherited from the parent if not explicitly defined.
- i18n: migration PO files to JSON.

### Fixed

Expand Down
5 changes: 5 additions & 0 deletions CMake/MacOsConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,10 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if(EXISTS "$ENV{HOMEBREW_PREFIX}/opt/openblas/lib/")
link_directories($ENV{HOMEBREW_PREFIX}/opt/openblas/lib/)
endif()

if(EXISTS "$ENV{HOMEBREW_PREFIX}/opt/libomp/include")
set(OpenMP_CXX_INCLUDE_DIRS $ENV{HOMEBREW_PREFIX}/opt/libomp/include)
set(OpenMP_CXX_LIBRARIES $ENV{HOMEBREW_PREFIX}/opt/libomp/lib/libomp.dylib)
endif()
endif()
# ==============================================================================
14 changes: 0 additions & 14 deletions CMake/OpenMpConfig.cmake

This file was deleted.

2 changes: 0 additions & 2 deletions CMake/PackageConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ if(UNIX)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libboost-chrono1.83.0 (>= 1.83.0)")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libboost-filesystem1.83.0 (>= 1.83.0)")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libboost-iostreams1.83.0 (>= 1.83.0)")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libboost-locale1.83.0 (>= 1.83.0)")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libboost-serialization1.83.0 (>= 1.83.0)")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libboost-thread1.83.0 (>= 1.83.0)")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libc6 (>= 2.39)")
Expand Down Expand Up @@ -108,7 +107,6 @@ if(UNIX)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libboost-chrono1.74.0 (>= 1.74.0)")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libboost-filesystem1.74.0 (>= 1.74.0)")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libboost-iostreams1.74.0 (>= 1.74.0)")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libboost-locale1.74.0 (>= 1.74.0)")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libboost-serialization1.74.0 (>= 1.74.0)")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libboost-thread1.74.0 (>= 1.74.0)")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libc6 (>= 2.35)")
Expand Down
4 changes: 0 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,6 @@ list(
regex
date_time
iostreams)
if(NOT WITHOUT_LOCALIZATION_MODULE)
list(APPEND boost_components locale)
endif()
find_package(
Boost 1.64.0
COMPONENTS ${boost_components}
Expand Down Expand Up @@ -296,7 +293,6 @@ endif()
# ==============================================================================
if(NOT WITHOUT_OPENMP)
find_package(OpenMP)
include(OpenMpConfig)
endif()
# ==============================================================================
if(NOT WITHOUT_FILE_ARCHIVER_MODULE)
Expand Down
11 changes: 0 additions & 11 deletions NelSon.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NelSon-gui", "modules\main\nelson_gui\NelSon-gui.vcxproj", "{F34BD496-D9B3-4C25-A9E9-C91EB3E35C12}"
ProjectSection(ProjectDependencies) = postProject
{02AD5A6D-F80A-4888-9178-29A0D7D04814} = {02AD5A6D-F80A-4888-9178-29A0D7D04814}
{02DDE6F4-A726-40B4-8A89-A959DC285284} = {02DDE6F4-A726-40B4-8A89-A959DC285284}
{075F60AD-38BA-4531-9D46-7453E3416E15} = {075F60AD-38BA-4531-9D46-7453E3416E15}
{23DD3B6A-49AE-4AD1-AC80-CCAD6857682D} = {23DD3B6A-49AE-4AD1-AC80-CCAD6857682D}
{A6D3C7A0-E53A-4647-8FA2-CF065B696BA4} = {A6D3C7A0-E53A-4647-8FA2-CF065B696BA4}
Expand Down Expand Up @@ -325,8 +324,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nlsI18n_builtin", "modules\
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "generatepo", "tools\gettext\generatepo\generatepo.vcxproj", "{5216969B-4BD4-444C-B9F4-3C4E0D891CE5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "generatemo", "tools\gettext\generatemo\generatemo.vcxproj", "{02DDE6F4-A726-40B4-8A89-A959DC285284}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nlsHelp_browser_builtin", "modules\help_browser\builtin\c\nlsHelp_browser_builtin.vcxproj", "{C4A4AE3B-B48F-4D0D-BB59-8509B449A90D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nlsHelp_browser", "modules\help_browser\src\c\nlsHelp_browser.vcxproj", "{E43CFAE1-33B1-44DA-9354-874D21EFA8EF}"
Expand Down Expand Up @@ -1062,14 +1059,6 @@ Global
{5216969B-4BD4-444C-B9F4-3C4E0D891CE5}.Debug|x64.ActiveCfg = Debug|x64
{5216969B-4BD4-444C-B9F4-3C4E0D891CE5}.Release|Win32.ActiveCfg = Release|Win32
{5216969B-4BD4-444C-B9F4-3C4E0D891CE5}.Release|x64.ActiveCfg = Release|x64
{02DDE6F4-A726-40B4-8A89-A959DC285284}.Debug|Win32.ActiveCfg = Debug|Win32
{02DDE6F4-A726-40B4-8A89-A959DC285284}.Debug|Win32.Build.0 = Debug|Win32
{02DDE6F4-A726-40B4-8A89-A959DC285284}.Debug|x64.ActiveCfg = Debug|x64
{02DDE6F4-A726-40B4-8A89-A959DC285284}.Debug|x64.Build.0 = Debug|x64
{02DDE6F4-A726-40B4-8A89-A959DC285284}.Release|Win32.ActiveCfg = Release|Win32
{02DDE6F4-A726-40B4-8A89-A959DC285284}.Release|Win32.Build.0 = Release|Win32
{02DDE6F4-A726-40B4-8A89-A959DC285284}.Release|x64.ActiveCfg = Release|x64
{02DDE6F4-A726-40B4-8A89-A959DC285284}.Release|x64.Build.0 = Release|x64
{C4A4AE3B-B48F-4D0D-BB59-8509B449A90D}.Debug|Win32.ActiveCfg = Debug|Win32
{C4A4AE3B-B48F-4D0D-BB59-8509B449A90D}.Debug|Win32.Build.0 = Debug|Win32
{C4A4AE3B-B48F-4D0D-BB59-8509B449A90D}.Debug|x64.ActiveCfg = Debug|x64
Expand Down
1 change: 0 additions & 1 deletion bin/bin.iss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Source: {#RootPath}bin\{#BinPath}\boost_chrono-{#BOOST_TARGET}.dll; DestDir: {ap
Source: {#RootPath}bin\{#BinPath}\boost_date_time-{#BOOST_TARGET}.dll; DestDir: {app}\bin\{#BinPath}\; Components: {#COMPONENT_NELSON};
Source: {#RootPath}bin\{#BinPath}\boost_filesystem-{#BOOST_TARGET}.dll; DestDir: {app}\bin\{#BinPath}\; Components: {#COMPONENT_NELSON};
Source: {#RootPath}bin\{#BinPath}\boost_iostreams-{#BOOST_TARGET}.dll; DestDir: {app}\bin\{#BinPath}\; Components: {#COMPONENT_NELSON};
Source: {#RootPath}bin\{#BinPath}\boost_locale-{#BOOST_TARGET}.dll; DestDir: {app}\bin\{#BinPath}\; Components: {#COMPONENT_NELSON};
Source: {#RootPath}bin\{#BinPath}\boost_program_options-{#BOOST_TARGET}.dll; DestDir: {app}\bin\{#BinPath}\; Components: {#COMPONENT_NELSON};
Source: {#RootPath}bin\{#BinPath}\boost_regex-{#BOOST_TARGET}.dll; DestDir: {app}\bin\{#BinPath}\; Components: {#COMPONENT_NELSON};
Source: {#RootPath}bin\{#BinPath}\boost_system-{#BOOST_TARGET}.dll; DestDir: {app}\bin\{#BinPath}\; Components: {#COMPONENT_NELSON};
Expand Down
4 changes: 2 additions & 2 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
files:
- source: /locale/en_US/LC_MESSAGES/nelson.po
translation: /locale/%locale_with_underscore%/LC_MESSAGES/nelson.po
- source: /locale/nelson-en_US.json
translation: /locale/nelson-%locale_with_underscore%.json
2 changes: 0 additions & 2 deletions etc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ include(GNUInstallDirs)
# ==============================================================================
install(FILES ${CMAKE_SOURCE_DIR}/etc/finish.m
DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/etc)
install(FILES ${CMAKE_SOURCE_DIR}/etc/languages.conf
DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/etc)
install(FILES ${CMAKE_SOURCE_DIR}/etc/defaults.conf
DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/etc)
install(FILES ${CMAKE_SOURCE_DIR}/etc/startup.m
Expand Down
1 change: 0 additions & 1 deletion etc/etc.iss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@
;==============================================================================
Source: {#RootPath}etc\startup.m; DestDir: {app}\etc\;
Source: {#RootPath}etc\finish.m; DestDir: {app}\etc\;
Source: {#RootPath}etc\languages.conf; DestDir: {app}\etc\;
Source: {#RootPath}etc\defaults.conf; DestDir: {app}\etc\;
;==============================================================================
1 change: 0 additions & 1 deletion etc/languages.conf

This file was deleted.

9 changes: 5 additions & 4 deletions locale/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
# ==============================================================================
if(NOT WITHOUT_LOCALIZATION_MODULE)
include(GNUInstallDirs)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/en_US/LC_MESSAGES/nelson.mo
DESTINATION ${CMAKE_INSTALL_LOCALEDIR}/en_US/LC_MESSAGES)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/fr_FR/LC_MESSAGES/nelson.mo
DESTINATION ${CMAKE_INSTALL_LOCALEDIR}/fr_FR/LC_MESSAGES)
install(FILES ${CMAKE_SOURCE_DIR}/locale/nelson-en_US.json
DESTINATION ${CMAKE_INSTALL_DATADIR}/locale)
install(FILES ${CMAKE_SOURCE_DIR}/locale/nelson-fr_FR.json
DESTINATION ${CMAKE_INSTALL_DATADIR}/locale)
endif()
# ==============================================================================

Loading

0 comments on commit 031c63c

Please sign in to comment.