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 1
1
#include " node.h"
2
+ #include " node_i18n.h"
2
3
#include " env.h"
3
4
#include " env-inl.h"
4
5
#include " util.h"
@@ -28,7 +29,18 @@ using v8::ReadOnly;
28
29
void InitConfig (Local<Object> target,
29
30
Local<Value> unused,
30
31
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
32
44
}
33
45
34
46
} // 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[];
42
42
#endif
43
43
44
44
namespace node {
45
+
46
+ bool flag_icu_data_dir = false ;
47
+
45
48
namespace i18n {
46
49
47
50
bool InitializeICUDirectory (const char * icu_data_path) {
48
51
if (icu_data_path != nullptr ) {
52
+ flag_icu_data_dir = true ;
49
53
u_setDataDirectory (icu_data_path);
50
54
return true ; // no error
51
55
} else {
Original file line number Diff line number Diff line change 6
6
#if defined(NODE_HAVE_I18N_SUPPORT)
7
7
8
8
namespace node {
9
+
10
+ extern bool flag_icu_data_dir;
11
+
9
12
namespace i18n {
10
13
11
14
bool InitializeICUDirectory (const char * icu_data_path);
You can’t perform that action at this time.
0 commit comments