File tree Expand file tree Collapse file tree 8 files changed +23
-32
lines changed Expand file tree Collapse file tree 8 files changed +23
-32
lines changed Original file line number Diff line number Diff line change 11import  i18n  from  'i18next' ; 
22import  { initReactI18next }  from  'react-i18next' ; 
33
4- import  jaResources  from  '../locale/ja/LC_MESSAGES/loris.json' ; 
5- import  hiResources  from  '../locale/hi/LC_MESSAGES/loris.json' ; 
6- import  esResources  from  '../locale/es/LC_MESSAGES/loris.json' ; 
7- 
84const  resources  =  { 
95  ja : { 
10-     loris : jaResources , 
6+     loris : require ( '../locale/ja/LC_MESSAGES/loris.json' ) , 
117  } , 
128  hi : { 
13-     loris : hiResources , 
9+     loris : require ( '../locale/hi/LC_MESSAGES/loris.json' ) , 
1410  } , 
1511  es : { 
16-     loris : esResources , 
12+     loris : require ( '../es/LC_MESSAGES/loris.json' ) , 
1713  } , 
1814} ; 
1915
Original file line number Diff line number Diff line change @@ -12,9 +12,6 @@ import OpenProfileForm from './openProfileForm';
1212import  i18n  from  'I18nSetup' ; 
1313import  { withTranslation }  from  'react-i18next' ; 
1414
15- import  jaStrings  from  '../locale/ja/LC_MESSAGES/candidate_list.json' ; 
16- import  hiStrings  from  '../locale/hi/LC_MESSAGES/candidate_list.json' ; 
17- 
1815/** 
1916 * Candidate List 
2017 * 
@@ -407,8 +404,10 @@ CandidateListIndex.propTypes = {
407404
408405window . addEventListener ( 'load' ,  ( )  =>  { 
409406  const  args  =  QueryString . get ( ) ; 
410-   i18n . addResourceBundle ( 'ja' ,  'candidate_list' ,  jaStrings ) ; 
411-   i18n . addResourceBundle ( 'hi' ,  'candidate_list' ,  hiStrings ) ; 
407+   i18n . addResourceBundle ( 
408+ 	  'ja' ,  'candidate_list' ,  require ( '../locale/ja/LC_MESSAGES/candidate_list.json' ) ) ; 
409+   i18n . addResourceBundle ( 'hi' ,  'candidate_list' ,  require ( '../locale/hi/LC_MESSAGES/candidate_list.json' ) ) ; 
410+ 
412411
413412
414413  const  CLIndex  =  withTranslation ( 
Original file line number Diff line number Diff line change @@ -13,9 +13,6 @@ import UploadFileForm from './uploadFileForm';
1313import  AddPermissionForm  from  './addPermissionForm' ; 
1414import  ManagePermissionsForm  from  './managePermissionsForm' ; 
1515
16- import  hiStrings  from  '../locale/hi/LC_MESSAGES/data_release.json' ; 
17- import  jaStrings  from  '../locale/ja/LC_MESSAGES/data_release.json' ; 
18- 
1916/** 
2017 * Data Release 
2118 * 
@@ -244,8 +241,10 @@ DataReleaseIndex.propTypes = {
244241} ; 
245242
246243window . addEventListener ( 'load' ,  ( )  =>  { 
247-   i18n . addResourceBundle ( 'ja' ,  'data_release' ,  jaStrings ) ; 
248-   i18n . addResourceBundle ( 'hi' ,  'data_release' ,  hiStrings ) ; 
244+   i18n . addResourceBundle ( 'ja' ,  'data_release' ,  require ( '../locale/ja/LC_MESSAGES/data_release.json' ) ) ; 
245+   i18n . addResourceBundle ( 'hi' ,  'data_release' ,  require ( '../locale/hi/LC_MESSAGES/data_release.json' ) ) ; 
246+ 
247+ 
249248  const  Index  =  withTranslation ( 
250249    [ 'data_release' ,  'loris' ] 
251250  ) ( DataReleaseIndex ) ; 
Original file line number Diff line number Diff line change @@ -10,9 +10,6 @@ import FilterableDataTable from 'FilterableDataTable';
1010
1111import  fetchDataStream  from  'jslib/fetchDataStream' ; 
1212
13- import  hiStrings  from  '../locale/hi/LC_MESSAGES/datadict.json' ; 
14- import  jaStrings  from  '../locale/ja/LC_MESSAGES/datadict.json' ; 
15- 
1613/** 
1714 * Data Dictionary Page. 
1815 * 
@@ -239,8 +236,10 @@ DataDictIndex.propTypes = {
239236} ; 
240237
241238window . addEventListener ( 'load' ,  ( )  =>  { 
242-   i18n . addResourceBundle ( 'hi' ,  'datadict' ,  hiStrings ) ; 
243-   i18n . addResourceBundle ( 'ja' ,  'datadict' ,  jaStrings ) ; 
239+   i18n . addResourceBundle ( 'hi' ,  'datadict' ,  require ( '../locale/hi/LC_MESSAGES/datadict.json' ) ) ; 
240+   i18n . addResourceBundle ( 'ja' ,  'datadict' ,  require ( '../locale/ja/LC_MESSAGES/datadict.json' ) ) ; 
241+ 
242+ 
244243  const  Index  =  withTranslation ( 
245244    [ 'datadict' ,  'loris' ] 
246245  ) ( DataDictIndex ) ; 
Original file line number Diff line number Diff line change @@ -9,9 +9,6 @@ import Loader from 'Loader';
99import  FilterableDataTable  from  'FilterableDataTable' ; 
1010import  swal  from  'sweetalert2' ; 
1111
12- import  hiStrings  from  '../locale/hi/LC_MESSAGES/dictionary.json' ; 
13- import  jaStrings  from  '../locale/ja/LC_MESSAGES/dictionary.json' ; 
14- 
1512/** 
1613 * Data Dictionary Page. 
1714 * 
@@ -357,8 +354,9 @@ DataDictIndex.propTypes = {
357354} ; 
358355
359356window . addEventListener ( 'load' ,  ( )  =>  { 
360-   i18n . addResourceBundle ( 'ja' ,  'dictionary' ,  jaStrings ) ; 
361-   i18n . addResourceBundle ( 'hi' ,  'dictionary' ,  hiStrings ) ; 
357+   i18n . addResourceBundle ( 'ja' ,  'dictionary' ,  require ( '../locale/ja/LC_MESSAGES/dictionary.json' ) ) ; 
358+   i18n . addResourceBundle ( 'hi' ,  'dictionary' ,  require ( '../locale/hi/LC_MESSAGES/dictionary.json' ) ) ; 
359+ 
362360  const  Index  =  withTranslation ( 
363361    [ 'dictionary' ,  'loris' ] 
364362  ) ( DataDictIndex ) ; 
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ import {useTranslation} from 'react-i18next';
1212import  '../css/WidgetIndex.css' ; 
1313
1414import  { setupCharts }  from  './widgets/helpers/chartBuilder' ; 
15- import  jaStrings  from  '../locale/ja/LC_MESSAGES/statistics.json' ; 
1615
1716/** 
1817 * WidgetIndex - the main window. 
@@ -26,7 +25,8 @@ const WidgetIndex = (props) => {
2625  const  [ modalChart ,  setModalChart ]  =  useState ( null ) ; 
2726  const  { t,  i18n}  =  useTranslation ( ) ; 
2827  useEffect (  ( )  =>  { 
29-     i18n . addResourceBundle ( 'ja' ,  'statistics' ,  jaStrings ) ; 
28+ 
29+     i18n . addResourceBundle ( 'ja' ,  'statistics' ,  require ( '../locale/ja/LC_MESSAGES/statistics.json' ) ) ; 
3030  } ,  [ ] ) ; 
3131
3232  // used by recruitment.js and studyprogression.js to display each chart. 
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ import Panel from 'Panel';
66import  { QueryChartForm }  from  './helpers/queryChartForm' ; 
77import  { setupCharts }  from  './helpers/chartBuilder' ; 
88import  { useTranslation }  from  'react-i18next' ; 
9- import  jaStrings  from  '../../locale/ja/LC_MESSAGES/statistics.json' ; 
109
1110/** 
1211 * StudyProgression - a widget containing statistics for study data. 
@@ -21,7 +20,8 @@ const StudyProgression = (props) => {
2120  const  [ showFiltersRecruitment ,  setShowFiltersRecruitment ]  =  useState ( false ) ; 
2221  const  [ activeView ,  setActiveView ]  =  useState ( 0 ) ; 
2322  useEffect (  ( )  =>  { 
24-     i18n . addResourceBundle ( 'ja' ,  'statistics' ,  jaStrings ) ; 
23+     i18n . addResourceBundle ( 'ja' ,  'statistics' ,  require ( '../../locale/ja/LC_MESSAGES/statistics.json' ) ) ; 
24+ 
2525
2626    // Re-set default state that depended on the translation 
2727    let  newdetails  =  { ...chartDetails } ; 
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ public function process(
7878        $ loris  = $ request ->getAttribute ("loris " );
7979        $ lang   = self ::detectLocale ($ loris , $ request );
8080        if  ($ lang  !== null ) {
81-             \setlocale (LC_MESSAGES , $ lang  . '.utf8 ' );
81+             \setlocale (LC_ALL , $ lang  . '.utf8 ' );
8282            return  $ this  ->next ->process (
8383                $ request ->withAttribute ("locale " , $ lang ),
8484                $ handler
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments