Skip to content

Commit

Permalink
Remove native language support
Browse files Browse the repository at this point in the history
  • Loading branch information
Jookia committed Nov 19, 2022
1 parent 78c09ec commit dca32ba
Show file tree
Hide file tree
Showing 136 changed files with 1 addition and 226,528 deletions.
27 changes: 0 additions & 27 deletions CMakeLists.txt
Expand Up @@ -87,7 +87,6 @@ add_plugin(support/glib "native Glib found" FALSE)
add_plugin(support/zlib "native zlib found" FALSE)
add_plugin(support/libpng "native libpng found" FALSE)
add_plugin(support/wordexp "native wordexp found" FALSE)
add_plugin(support/gettext_intl "native libintl found" FALSE)
add_module(font/freetype "freetype not found" FALSE)
add_module(graphics/android "FreeType library not found" FALSE)
add_module(graphics/gd "FreeType library not found" FALSE)
Expand Down Expand Up @@ -116,7 +115,6 @@ add_module(vehicle/qt5 "Qt5 libraries not found" FALSE)
add_module(speech/speech_dispatcher "speech_dispatcher lib not found" FALSE)
add_module(autoload/osso "Default" FALSE)
add_module(map/garmin "Garmin library not found" FALSE)
add_feature(USE_NATIVE_LANGUAGE_SUPPORT "Gettext not found and not on Windows" FALSE)
set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_SOURCE_DIR}/cpack.cmake")
set(CPACK_PACKAGE_VENDOR "Navit team")
set(CPACK_PACKAGE_VERSION_MAJOR ${NAVIT_VERSION_MAJOR})
Expand Down Expand Up @@ -161,7 +159,6 @@ find_package(SDL_image)
find_package(OpenGL)
find_package(GLUT)
find_package(GTK2 2.6 COMPONENTS gtk)
find_package(Gettext)
find_package(PNG)
find_package(DBusGLib)
find_package(PythonLibs)
Expand Down Expand Up @@ -239,20 +236,6 @@ CHECK_FUNCTION_EXISTS(getdelim HAVE_GETDELIM)
CHECK_FUNCTION_EXISTS(getline HAVE_GETLINE)
CHECK_FUNCTION_EXISTS(fsync HAVE_FSYNC)


### Configure build
#Required libraries, supplied with navit
if (NOT HAVE_LIBINTL)
set_with_reason(support/gettext_intl "native libintl missing" TRUE)
set(USE_LIBGNUINTL TRUE)
else()
CHECK_LIBRARY_EXISTS(intl libintl_fprintf "" NEEDS_LIBINTL)
if (NEEDS_LIBINTL)
list(APPEND NAVIT_LIBS intl)
set(INTL_LIBS intl)
endif(NEEDS_LIBINTL)
endif(NOT HAVE_LIBINTL)

if (CMAKE_USE_PTHREADS_INIT)
if (NOT ANDROID)
list(APPEND NAVIT_LIBS pthread)
Expand Down Expand Up @@ -477,10 +460,6 @@ if (LIBOSSO_FOUND)
set_with_reason(autoload/osso "Maemo osso library found" TRUE ${LIBOSSO_LIBRARIES})
endif(LIBOSSO_FOUND)

if (GETTEXT_FOUND)
set_with_reason(USE_NATIVE_LANGUAGE_SUPPORT "Gettext found" TRUE)
endif(GETTEXT_FOUND)

#Independent modules
add_module(graphics/null "Default" TRUE)
add_module(osd/core "Default" TRUE)
Expand Down Expand Up @@ -637,7 +616,6 @@ if(WIN32 OR WINCE)
set(HAVE_PRAGMA_PACK 1)
add_plugin(support/xgetopt "Windows detected" TRUE)
endif(MSVC)
set_with_reason(USE_NATIVE_LANGUAGE_SUPPORT "Windows detected" TRUE)
enable_language(RC)

set(XSLTS "windows;${XSLTS}" CACHE STRING "define a semicolon seperated list of XSLTs to process")
Expand Down Expand Up @@ -857,8 +835,3 @@ if (NOT NAVIT_DEPENDENCY_ERROR)
endif(NOT NAVIT_DEPENDENCY_ERROR)

add_subdirectory (navit)


if (USE_NATIVE_LANGUAGE_SUPPORT)
add_subdirectory (po)
endif(USE_NATIVE_LANGUAGE_SUPPORT)
10 changes: 0 additions & 10 deletions cmake/FindXGettextGlade.cmake

This file was deleted.

3 changes: 0 additions & 3 deletions cmake/navit_po_version.cmake

This file was deleted.

1 change: 0 additions & 1 deletion config.h.cmake
@@ -1,4 +1,3 @@
#cmakedefine USE_NATIVE_LANGUAGE_SUPPORT 1
#cmakedefine HAVE_MALLOC_H 1
#cmakedefine HAVE_SYS_MOUNT_H 1
#cmakedefine HAVE_STDINT_H 1
Expand Down
54 changes: 0 additions & 54 deletions navit/navit_nls.c
Expand Up @@ -7,71 +7,26 @@
#include "libc.h"
#endif

#ifdef USE_LIBGNUINTL
#include <libgnuintl.h>
#else
#include <libintl.h>
#endif
#ifdef USE_NATIVE_LANGUAGE_SUPPORT
static GList *textdomains;
#endif

char *
navit_nls_add_textdomain(const char *package, const char *dir)
{
#ifdef USE_NATIVE_LANGUAGE_SUPPORT
char *ret=bindtextdomain(package, dir);
bind_textdomain_codeset(package, "UTF-8");
textdomains=g_list_append(textdomains, g_strdup(package));
return ret;
#else
return NULL;
#endif
}

void
navit_nls_remove_textdomain(const char *package)
{
#ifdef USE_NATIVE_LANGUAGE_SUPPORT
GList *i=textdomains;
while (i) {
if (!strcmp(i->data, package)) {
textdomains=g_list_remove_all(textdomains, i->data);
g_free(i->data);
return;
}
i=g_list_next(i);
}
#endif
}

const char *
navit_nls_gettext(const char *msgid)
{
#ifdef USE_NATIVE_LANGUAGE_SUPPORT
GList *i=textdomains;
while (i) {
const char *ret=dgettext(i->data, msgid);
if (ret != msgid)
return ret;
i=g_list_next(i);
}
#endif
return msgid;
}

const char *
navit_nls_ngettext(const char *msgid, const char *msgid_plural, unsigned long int n)
{
#ifdef USE_NATIVE_LANGUAGE_SUPPORT
GList *i=textdomains;
while (i) {
const char *ret=dngettext(i->data, msgid, msgid_plural, n);
if (ret != msgid && ret != msgid_plural)
return ret;
i=g_list_next(i);
}
#endif
if (n == 1) {
return msgid;
} else {
Expand All @@ -82,13 +37,4 @@ navit_nls_ngettext(const char *msgid, const char *msgid_plural, unsigned long in
void
navit_nls_main_init(void)
{
#ifdef USE_NATIVE_LANGUAGE_SUPPORT
#ifdef FORCE_LOCALE
#define STRINGIFY2(x) #x
#define STRINGIFY(x) STRINGIFY2(x)
setlocale(LC_MESSAGES,STRINGIFY(FORCE_LOCALE));
#endif
navit_nls_add_textdomain(PACKAGE, getenv("NAVIT_LOCALEDIR"));
textdomain(PACKAGE);
#endif
}
4 changes: 0 additions & 4 deletions navit/support/gettext_intl/CMakeLists.txt

This file was deleted.

4 changes: 0 additions & 4 deletions navit/support/gettext_intl/ChangeLog

This file was deleted.

1 change: 0 additions & 1 deletion navit/support/gettext_intl/VERSION

This file was deleted.

0 comments on commit dca32ba

Please sign in to comment.