File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 11#include " node.h"
2+ #include " node_i18n.h"
23#include " env.h"
34#include " env-inl.h"
45#include " util.h"
@@ -28,7 +29,18 @@ using v8::ReadOnly;
2829void InitConfig (Local<Object> target,
2930 Local<Value> unused,
3031 Local<Context> context) {
31- // Environment* env = Environment::GetCurrent(context);
32+ Environment* env = Environment::GetCurrent (context);
33+
34+ #ifdef NODE_HAVE_I18N_SUPPORT
35+ READONLY_BOOLEAN_PROPERTY (" hasIntl" );
36+
37+ #ifdef NODE_HAVE_SMALL_ICU
38+ READONLY_BOOLEAN_PROPERTY (" hasSmallICU" );
39+ #endif // NODE_HAVE_SMALL_ICU
40+
41+ if (flag_icu_data_dir)
42+ READONLY_BOOLEAN_PROPERTY (" usingICUDataDir" );
43+ #endif // NODE_HAVE_I18N_SUPPORT
3244}
3345
3446} // namespace node
Original file line number Diff line number Diff line change @@ -42,10 +42,14 @@ extern "C" const char U_DATA_API SMALL_ICUDATA_ENTRY_POINT[];
4242#endif
4343
4444namespace node {
45+
46+ bool flag_icu_data_dir = false ;
47+
4548namespace i18n {
4649
4750bool InitializeICUDirectory (const char * icu_data_path) {
4851 if (icu_data_path != nullptr ) {
52+ flag_icu_data_dir = true ;
4953 u_setDataDirectory (icu_data_path);
5054 return true ; // no error
5155 } else {
Original file line number Diff line number Diff line change 66#if defined(NODE_HAVE_I18N_SUPPORT)
77
88namespace node {
9+
10+ extern bool flag_icu_data_dir;
11+
912namespace i18n {
1013
1114bool InitializeICUDirectory (const char * icu_data_path);
You can’t perform that action at this time.
0 commit comments