[build] Update the i18n processing to fit the out-of-tree build

This commit is contained in:
Romain Goyet
2019-03-05 17:14:34 +01:00
committed by LeaNumworks
parent 4f1d74f44b
commit 4f2c7a3763
59 changed files with 78 additions and 67 deletions

4
.gitignore vendored
View File

@@ -1,7 +1,3 @@
# No i18n headers
apps/i18n.h
apps/i18n.cpp
# Quiz output # Quiz output
quiz/src/symbols.c quiz/src/symbols.c

View File

@@ -43,6 +43,12 @@ epsilon_app_names = '$(foreach i,${EPSILON_APPS},"$(i)", )'
$(call object_for,apps/apps_container_storage.cpp apps/main.cpp): CXXFLAGS += $(snapshot_includes) -DAPPS_CONTAINER_APPS_DECLARATION="$(apps_declaration)" -DAPPS_CONTAINER_SNAPSHOT_DECLARATIONS="$(snapshots_declaration)" -DAPPS_CONTAINER_SNAPSHOT_CONSTRUCTORS="$(snapshots_construction)" -DAPPS_CONTAINER_SNAPSHOT_LIST="$(snapshots_list)" -DAPPS_CONTAINER_SNAPSHOT_COUNT=$(snapshots_count) -DEPSILON_APPS_NAMES=$(epsilon_app_names) $(call object_for,apps/apps_container_storage.cpp apps/main.cpp): CXXFLAGS += $(snapshot_includes) -DAPPS_CONTAINER_APPS_DECLARATION="$(apps_declaration)" -DAPPS_CONTAINER_SNAPSHOT_DECLARATIONS="$(snapshots_declaration)" -DAPPS_CONTAINER_SNAPSHOT_CONSTRUCTORS="$(snapshots_construction)" -DAPPS_CONTAINER_SNAPSHOT_LIST="$(snapshots_list)" -DAPPS_CONTAINER_SNAPSHOT_COUNT=$(snapshots_count) -DEPSILON_APPS_NAMES=$(epsilon_app_names)
# I18n file generation
# The header is refered to as <apps/i18n.h> so make sure it's findable this way
SFLAGS += -I$(OUTPUT_DIRECTORY)
i18n_files += $(addprefix apps/language_,$(addsuffix .universal.i18n, $(EPSILON_I18N))) i18n_files += $(addprefix apps/language_,$(addsuffix .universal.i18n, $(EPSILON_I18N)))
i18n_files += $(addprefix apps/,\ i18n_files += $(addprefix apps/,\
shared.de.i18n\ shared.de.i18n\
@@ -63,14 +69,23 @@ i18n_files += $(addprefix apps/,\
variables.pt.i18n\ variables.pt.i18n\
) )
apps/i18n.h: apps/i18n.cpp $(eval $(call rule_for, \
apps/i18n.cpp: $(i18n_files) I18N, \
@echo "I18N $@" apps/i18n.cpp, \
$(Q) $(PYTHON) apps/i18n.py --header $(subst .cpp,.h,$@) --implementation $@ --locales $(EPSILON_I18N) --files $^ $(i18n_files), \
$$(PYTHON) apps/i18n.py --header $$(subst .cpp,.h,$$@) --implementation $$@ --locales $$(EPSILON_I18N) --files $$^ \
))
#$(app_objs): apps/i18n.h # Make sure apps/i18n.o is built
# The extension added to app_src doesn't really matter since it'll be processed
# by the object_for function.
app_src += apps/i18n.py
products += apps/i18n.h apps/i18n.cpp $(OUTPUT_DIRECTORY)/apps/i18n.h: $(OUTPUT_DIRECTORY)/apps/i18n.cpp
$(call object_for,$(app_src)): $(OUTPUT_DIRECTORY)/apps/i18n.h
# Handle PNG files
$(eval $(call depends_on_image,apps/title_bar_view.cpp,apps/exam_icon.png)) $(eval $(call depends_on_image,apps/title_bar_view.cpp,apps/exam_icon.png))

View File

@@ -1,7 +1,7 @@
#include "app.h" #include "app.h"
#include "../apps_container.h" #include "../apps_container.h"
#include "calculation_icon.h" #include "calculation_icon.h"
#include "../i18n.h" #include <apps/i18n.h>
#include <poincare/symbol.h> #include <poincare/symbol.h>
using namespace Poincare; using namespace Poincare;

View File

@@ -1,7 +1,7 @@
#include "app.h" #include "app.h"
#include "../apps_container.h" #include "../apps_container.h"
#include "code_icon.h" #include "code_icon.h"
#include "../i18n.h" #include <apps/i18n.h>
#include "helpers.h" #include "helpers.h"
namespace Code { namespace Code {

View File

@@ -1,6 +1,6 @@
#include "menu_controller.h" #include "menu_controller.h"
#include "app.h" #include "app.h"
#include "../i18n.h" #include <apps/i18n.h>
#include "../apps_container.h" #include "../apps_container.h"
#include <assert.h> #include <assert.h>
#include <escher/metric.h> #include <escher/metric.h>

View File

@@ -2,7 +2,7 @@
#define CODE_SCRIPT_PARAMETER_CONTROLLER_H #define CODE_SCRIPT_PARAMETER_CONTROLLER_H
#include <escher.h> #include <escher.h>
#include "../i18n.h" #include <apps/i18n.h>
#include "script_store.h" #include "script_store.h"
namespace Code { namespace Code {

View File

@@ -1,6 +1,6 @@
#include "empty_battery_window.h" #include "empty_battery_window.h"
#include "global_preferences.h" #include "global_preferences.h"
#include "i18n.h" #include <apps/i18n.h>
extern "C" { extern "C" {
#include <assert.h> #include <assert.h>
} }

View File

@@ -1,6 +1,6 @@
#include "exam_pop_up_controller.h" #include "exam_pop_up_controller.h"
#include "apps_container.h" #include "apps_container.h"
#include "i18n.h" #include <apps/i18n.h>
#include "global_preferences.h" #include "global_preferences.h"
#include <assert.h> #include <assert.h>

View File

@@ -1,7 +1,7 @@
#ifndef APPS_GLOBAL_PREFERENCES_H #ifndef APPS_GLOBAL_PREFERENCES_H
#define APPS_GLOBAL_PREFERENCES_H #define APPS_GLOBAL_PREFERENCES_H
#include "i18n.h" #include <apps/i18n.h>
class GlobalPreferences { class GlobalPreferences {
public: public:

View File

@@ -1,7 +1,7 @@
#include "app.h" #include "app.h"
#include "../apps_container.h" #include "../apps_container.h"
#include "graph_icon.h" #include "graph_icon.h"
#include "../i18n.h" #include <apps/i18n.h>
using namespace Poincare; using namespace Poincare;
using namespace Shared; using namespace Shared;

View File

@@ -1,5 +1,5 @@
#include "banner_view.h" #include "banner_view.h"
#include "../../i18n.h" #include <apps/i18n.h>
namespace Graph { namespace Graph {

View File

@@ -10,7 +10,7 @@
#include "root_graph_controller.h" #include "root_graph_controller.h"
#include "graph_view.h" #include "graph_view.h"
#include "banner_view.h" #include "banner_view.h"
#include "../../i18n.h" #include <apps/i18n.h>
namespace Graph { namespace Graph {

View File

@@ -1,6 +1,6 @@
#include "curve_parameter_controller.h" #include "curve_parameter_controller.h"
#include "graph_controller.h" #include "graph_controller.h"
#include "../../i18n.h" #include <apps/i18n.h>
#include <assert.h> #include <assert.h>
using namespace Shared; using namespace Shared;

View File

@@ -1,6 +1,6 @@
#include "storage_list_controller.h" #include "storage_list_controller.h"
#include "../app.h" #include "../app.h"
#include "../../i18n.h" #include <apps/i18n.h>
#include <assert.h> #include <assert.h>
#include <escher/metric.h> #include <escher/metric.h>
#include <apps/apps_container.h> #include <apps/apps_container.h>

View File

@@ -1,5 +1,5 @@
#include "pop_up_controller.h" #include "pop_up_controller.h"
#include "../i18n.h" #include <apps/i18n.h>
#include "../apps_container.h" #include "../apps_container.h"
#include <assert.h> #include <assert.h>

View File

@@ -1,5 +1,5 @@
#include "app.h" #include "app.h"
#include "../i18n.h" #include <apps/i18n.h>
#include "../apps_container.h" #include "../apps_container.h"
extern "C" { extern "C" {

View File

@@ -116,7 +116,7 @@ def print_header(data, path, locales):
def print_implementation(data, path, locales): def print_implementation(data, path, locales):
f = open(path, 'w') f = open(path, 'w')
f.write("#include \"i18n.h\"\n") f.write("#include \"i18n.h\"\n")
f.write("#include \"global_preferences.h\"\n") f.write("#include <apps/global_preferences.h>\n")
f.write("#include <assert.h>\n\n"); f.write("#include <assert.h>\n\n");
f.write("namespace I18n {\n\n") f.write("namespace I18n {\n\n")

View File

@@ -2,7 +2,7 @@
#define ON_BOARDING_POP_UP_CONTROLLER_H #define ON_BOARDING_POP_UP_CONTROLLER_H
#include <escher.h> #include <escher.h>
#include "../i18n.h" #include <apps/i18n.h>
#include "../shared/message_view.h" #include "../shared/message_view.h"
#include "../shared/ok_view.h" #include "../shared/ok_view.h"

View File

@@ -1,5 +1,5 @@
#include "app.h" #include "app.h"
#include "../i18n.h" #include <apps/i18n.h>
#include "probability_icon.h" #include "probability_icon.h"
#include <new> #include <new>

View File

@@ -1,6 +1,6 @@
#include "calculation_cell.h" #include "calculation_cell.h"
#include "responder_image_cell.h" #include "responder_image_cell.h"
#include "../i18n.h" #include <apps/i18n.h>
#include <assert.h> #include <assert.h>
namespace Probability { namespace Probability {

View File

@@ -4,7 +4,7 @@
#include <escher.h> #include <escher.h>
#include "../../constant.h" #include "../../constant.h"
#include "../../shared/curve_view_range.h" #include "../../shared/curve_view_range.h"
#include "../../i18n.h" #include <apps/i18n.h>
namespace Probability { namespace Probability {

View File

@@ -1,6 +1,6 @@
#include "app.h" #include "app.h"
#include "regression_icon.h" #include "regression_icon.h"
#include "../i18n.h" #include <apps/i18n.h>
using namespace Shared; using namespace Shared;

View File

@@ -3,7 +3,7 @@
#include <escher.h> #include <escher.h>
#include "store.h" #include "store.h"
#include "../i18n.h" #include <apps/i18n.h>
namespace Regression { namespace Regression {

View File

@@ -2,7 +2,7 @@
#define REGRESSION_MODEL_H #define REGRESSION_MODEL_H
#include <stdint.h> #include <stdint.h>
#include "../../i18n.h" #include <apps/i18n.h>
#include <poincare/context.h> #include <poincare/context.h>
#include <poincare/expression.h> #include <poincare/expression.h>
#include <poincare/layout.h> #include <poincare/layout.h>

View File

@@ -3,7 +3,7 @@
#include "store.h" #include "store.h"
#include <escher.h> #include <escher.h>
#include "../i18n.h" #include <apps/i18n.h>
namespace Regression { namespace Regression {

View File

@@ -1,6 +1,6 @@
#include "app.h" #include "app.h"
#include "settings_icon.h" #include "settings_icon.h"
#include "../i18n.h" #include <apps/i18n.h>
namespace Settings { namespace Settings {

View File

@@ -1,6 +1,6 @@
#include "main_controller.h" #include "main_controller.h"
#include "../global_preferences.h" #include "../global_preferences.h"
#include "../i18n.h" #include <apps/i18n.h>
#include <assert.h> #include <assert.h>
using namespace Poincare; using namespace Poincare;

View File

@@ -1,6 +1,6 @@
#include "expression_field_delegate_app.h" #include "expression_field_delegate_app.h"
#include <escher.h> #include <escher.h>
#include "../i18n.h" #include <apps/i18n.h>
#include "../apps_container.h" #include "../apps_container.h"
using namespace Poincare; using namespace Poincare;

View File

@@ -3,7 +3,7 @@
#include <escher.h> #include <escher.h>
#include "expression_model_store.h" #include "expression_model_store.h"
#include "../i18n.h" #include <apps/i18n.h>
namespace Shared { namespace Shared {

View File

@@ -6,7 +6,7 @@
#include "function_app.h" #include "function_app.h"
#include "list_parameter_controller.h" #include "list_parameter_controller.h"
#include "expression_model_list_controller.h" #include "expression_model_list_controller.h"
#include "../i18n.h" #include <apps/i18n.h>
namespace Shared { namespace Shared {

View File

@@ -3,7 +3,7 @@
#include <escher.h> #include <escher.h>
#include "interactive_curve_view_range.h" #include "interactive_curve_view_range.h"
#include "../i18n.h" #include <apps/i18n.h>
namespace Shared { namespace Shared {

View File

@@ -1,7 +1,7 @@
#include "language_controller.h" #include "language_controller.h"
#include "../global_preferences.h" #include "../global_preferences.h"
#include "../apps_container.h" #include "../apps_container.h"
#include "../i18n.h" #include <apps/i18n.h>
namespace Shared { namespace Shared {

View File

@@ -2,7 +2,7 @@
#define SHARED_LANGUAGE_CONTROLLER_H #define SHARED_LANGUAGE_CONTROLLER_H
#include <escher.h> #include <escher.h>
#include "../i18n.h" #include <apps/i18n.h>
namespace Shared { namespace Shared {

View File

@@ -4,7 +4,7 @@
#include <escher.h> #include <escher.h>
#include "function.h" #include "function.h"
#include "function_store.h" #include "function_store.h"
#include "../i18n.h" #include <apps/i18n.h>
namespace Shared { namespace Shared {

View File

@@ -1,5 +1,5 @@
#include "scrollable_exact_approximate_expressions_view.h" #include "scrollable_exact_approximate_expressions_view.h"
#include "../i18n.h" #include <apps/i18n.h>
#include <assert.h> #include <assert.h>
using namespace Poincare; using namespace Poincare;

View File

@@ -3,7 +3,7 @@
#include <escher.h> #include <escher.h>
#include "storage_expression_model_store.h" #include "storage_expression_model_store.h"
#include "../i18n.h" #include <apps/i18n.h>
namespace Shared { namespace Shared {

View File

@@ -7,7 +7,7 @@
#include "function_title_cell.h" #include "function_title_cell.h"
#include "storage_list_parameter_controller.h" #include "storage_list_parameter_controller.h"
#include "storage_expression_model_list_controller.h" #include "storage_expression_model_list_controller.h"
#include "../i18n.h" #include <apps/i18n.h>
namespace Shared { namespace Shared {

View File

@@ -3,7 +3,7 @@
#include <escher.h> #include <escher.h>
#include "storage_function_store.h" #include "storage_function_store.h"
#include "../i18n.h" #include <apps/i18n.h>
namespace Shared { namespace Shared {

View File

@@ -9,7 +9,7 @@
#include "values_parameter_controller.h" #include "values_parameter_controller.h"
#include "storage_values_function_parameter_controller.h" #include "storage_values_function_parameter_controller.h"
#include "interval_parameter_controller.h" #include "interval_parameter_controller.h"
#include "../i18n.h" #include <apps/i18n.h>
namespace Shared { namespace Shared {

View File

@@ -3,7 +3,7 @@
#include <escher.h> #include <escher.h>
#include "storage_function.h" #include "storage_function.h"
#include "../i18n.h" #include <apps/i18n.h>
namespace Shared { namespace Shared {

View File

@@ -3,7 +3,7 @@
#include <escher.h> #include <escher.h>
#include "double_pair_store.h" #include "double_pair_store.h"
#include "../i18n.h" #include <apps/i18n.h>
namespace Shared { namespace Shared {

View File

@@ -4,7 +4,7 @@
#include <poincare/context.h> #include <poincare/context.h>
#include <escher.h> #include <escher.h>
#include "input_event_handler_delegate_app.h" #include "input_event_handler_delegate_app.h"
#include "../i18n.h" #include <apps/i18n.h>
class AppsContainer; class AppsContainer;

View File

@@ -9,7 +9,7 @@
#include "values_parameter_controller.h" #include "values_parameter_controller.h"
#include "values_function_parameter_controller.h" #include "values_function_parameter_controller.h"
#include "interval_parameter_controller.h" #include "interval_parameter_controller.h"
#include "../i18n.h" #include <apps/i18n.h>
namespace Shared { namespace Shared {

View File

@@ -3,7 +3,7 @@
#include <escher.h> #include <escher.h>
#include "function.h" #include "function.h"
#include "../i18n.h" #include <apps/i18n.h>
namespace Shared { namespace Shared {

View File

@@ -4,7 +4,7 @@
#include <escher.h> #include <escher.h>
#include "interactive_curve_view_range.h" #include "interactive_curve_view_range.h"
#include "curve_view.h" #include "curve_view.h"
#include "../i18n.h" #include <apps/i18n.h>
namespace Shared { namespace Shared {

View File

@@ -3,7 +3,7 @@
#include <escher.h> #include <escher.h>
#include "lock_view.h" #include "lock_view.h"
#include "i18n.h" #include <apps/i18n.h>
class ShiftAlphaLockView : public View { class ShiftAlphaLockView : public View {
public: public:

View File

@@ -1,5 +1,5 @@
#include "app.h" #include "app.h"
#include "../i18n.h" #include <apps/i18n.h>
#include "solver_icon.h" #include "solver_icon.h"
using namespace Shared; using namespace Shared;

View File

@@ -3,7 +3,7 @@
#include "../constant.h" #include "../constant.h"
#include <assert.h> #include <assert.h>
#include <poincare/layout_helper.h> #include <poincare/layout_helper.h>
#include "../i18n.h" #include <apps/i18n.h>
using namespace Poincare; using namespace Poincare;

View File

@@ -1,6 +1,6 @@
#include "interval_controller.h" #include "interval_controller.h"
#include "app.h" #include "app.h"
#include "../i18n.h" #include <apps/i18n.h>
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>

View File

@@ -8,7 +8,7 @@
#include "equation_store.h" #include "equation_store.h"
#include "equation_list_view.h" #include "equation_list_view.h"
#include "equation_models_parameter_controller.h" #include "equation_models_parameter_controller.h"
#include "../i18n.h" #include <apps/i18n.h>
namespace Solver { namespace Solver {

View File

@@ -4,7 +4,7 @@
#include <escher.h> #include <escher.h>
#include "equation_store.h" #include "equation_store.h"
#include "../shared/scrollable_exact_approximate_expressions_cell.h" #include "../shared/scrollable_exact_approximate_expressions_cell.h"
#include "../i18n.h" #include <apps/i18n.h>
namespace Solver { namespace Solver {

View File

@@ -1,6 +1,6 @@
#include "app.h" #include "app.h"
#include "stat_icon.h" #include "stat_icon.h"
#include "../i18n.h" #include <apps/i18n.h>
using namespace Shared; using namespace Shared;

View File

@@ -3,7 +3,7 @@
#include <escher.h> #include <escher.h>
#include "../shared/banner_view.h" #include "../shared/banner_view.h"
#include "../i18n.h" #include <apps/i18n.h>
namespace Statistics { namespace Statistics {

View File

@@ -3,7 +3,7 @@
#include <escher.h> #include <escher.h>
#include "../shared/banner_view.h" #include "../shared/banner_view.h"
#include "../i18n.h" #include <apps/i18n.h>
namespace Statistics { namespace Statistics {

View File

@@ -1,5 +1,5 @@
#include "multiple_data_view_controller.h" #include "multiple_data_view_controller.h"
#include "../i18n.h" #include <apps/i18n.h>
#include <assert.h> #include <assert.h>
using namespace Shared; using namespace Shared;

View File

@@ -4,7 +4,7 @@
#include <escher.h> #include <escher.h>
#include "battery_view.h" #include "battery_view.h"
#include "shift_alpha_lock_view.h" #include "shift_alpha_lock_view.h"
#include "i18n.h" #include <apps/i18n.h>
class TitleBarView : public View { class TitleBarView : public View {
public: public:

View File

@@ -1,5 +1,5 @@
#include "usb_connected_controller.h" #include "usb_connected_controller.h"
#include "../i18n.h" #include <apps/i18n.h>
namespace USB { namespace USB {

View File

@@ -6,7 +6,7 @@
#include <escher.h> #include <escher.h>
#include "shared/global_context.h" #include "shared/global_context.h"
#include "variable_box_empty_controller.h" #include "variable_box_empty_controller.h"
#include "i18n.h" #include <apps/i18n.h>
class VariableBoxController : public NestedMenuController { class VariableBoxController : public NestedMenuController {
public: public:

View File

@@ -1,7 +1,7 @@
#include "variable_box_empty_controller.h" #include "variable_box_empty_controller.h"
#include <poincare/layout_helper.h> #include <poincare/layout_helper.h>
#include "graph/storage_cartesian_function_store.h" #include "graph/storage_cartesian_function_store.h"
#include "i18n.h" #include <apps/i18n.h>
#include <assert.h> #include <assert.h>
using namespace Poincare; using namespace Poincare;