@undp/carbon-library 1.0.156 → 1.0.157-CARBON-339.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. package/dist/cjs/index.js +46 -0
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/types/Components/Internationalization/i18n.d.ts +2 -0
  4. package/dist/cjs/types/Components/index.d.ts +1 -0
  5. package/dist/esm/index.js +46 -0
  6. package/dist/esm/index.js.map +1 -1
  7. package/dist/esm/types/Components/Internationalization/i18n.d.ts +2 -0
  8. package/dist/esm/types/Components/index.d.ts +1 -0
  9. package/dist/index.d.ts +1 -0
  10. package/dist/locales/i18n/addCompany/en.json +38 -0
  11. package/dist/locales/i18n/addProgramme/en.json +45 -0
  12. package/dist/locales/i18n/addUser/en.json +24 -0
  13. package/dist/locales/i18n/coBenifits/en.json +39 -0
  14. package/dist/locales/i18n/common/en.json +22 -0
  15. package/dist/locales/i18n/common/es.json +10 -0
  16. package/dist/locales/i18n/common/fr.json +10 -0
  17. package/dist/locales/i18n/company/en.json +22 -0
  18. package/dist/locales/i18n/companyProfile/en.json +43 -0
  19. package/dist/locales/i18n/creditTransfer/en.json +34 -0
  20. package/dist/locales/i18n/dashboard/en.json +71 -0
  21. package/dist/locales/i18n/dashboard/es.json +0 -0
  22. package/dist/locales/i18n/dashboard/fr.json +0 -0
  23. package/dist/locales/i18n/economic/en.json +35 -0
  24. package/dist/locales/i18n/environment/en.json +41 -0
  25. package/dist/locales/i18n/forgotPassword/en.json +9 -0
  26. package/dist/locales/i18n/genderParity/en.json +14 -0
  27. package/dist/locales/i18n/homepage/en.json +32 -0
  28. package/dist/locales/i18n/login/en.json +10 -0
  29. package/dist/locales/i18n/login/es.json +9 -0
  30. package/dist/locales/i18n/login/fr.json +9 -0
  31. package/dist/locales/i18n/mrvdashboard/en.json +29 -0
  32. package/dist/locales/i18n/mrvdashboard/es.json +0 -0
  33. package/dist/locales/i18n/mrvdashboard/fr.json +0 -0
  34. package/dist/locales/i18n/nav/en.json +11 -0
  35. package/dist/locales/i18n/ndcAction/en.json +89 -0
  36. package/dist/locales/i18n/passwordReset/en.json +10 -0
  37. package/dist/locales/i18n/programme/en.json +77 -0
  38. package/dist/locales/i18n/resetPassword/en.json +8 -0
  39. package/dist/locales/i18n/safeguards/en.json +73 -0
  40. package/dist/locales/i18n/social/en.json +41 -0
  41. package/dist/locales/i18n/user/en.json +16 -0
  42. package/dist/locales/i18n/userProfile/en.json +34 -0
  43. package/dist/locales/i18n/view/en.json +138 -0
  44. package/dist/locales/i18n/view/es.json +46 -0
  45. package/package.json +3 -1
@@ -0,0 +1,2 @@
1
+ import i18n from 'i18next';
2
+ export { i18n };
@@ -39,3 +39,4 @@ export * from "./Common/OrganisationStatus/organisationStatus";
39
39
  export * from "./Common/ProgrammeDocuments/programmeDocuments";
40
40
  export * from "./Common/UserRoleIcon/userRoleIcon";
41
41
  export * from "./Common/TimelineBody/timelineBody";
42
+ export * from "./Internationalization/i18n";
package/dist/esm/index.js CHANGED
@@ -11,6 +11,12 @@ import { InfoCircle, Lock, PersonDash, PlayCircle, PauseCircle, CircleFill, Clip
11
11
  import 'react-phone-number-input/style.css';
12
12
  import mapboxgl from 'mapbox-gl';
13
13
  import 'mapbox-gl/dist/mapbox-gl.css';
14
+ import i18n from 'i18next';
15
+ export { default as i18n } from 'i18next';
16
+ import { initReactI18next } from 'react-i18next';
17
+ import Backend from 'i18next-http-backend';
18
+ import LanguageDetector from 'i18next-browser-languagedetector';
19
+ import path from 'path';
14
20
 
15
21
  /******************************************************************************
16
22
  Copyright (c) Microsoft Corporation.
@@ -26374,5 +26380,45 @@ var TimelineBody = function (props) {
26374
26380
  React.createElement("div", { className: "remark-body" }, remark)))));
26375
26381
  };
26376
26382
 
26383
+ var modulePath = new URL(import.meta.url).pathname;
26384
+ var localesPath = path.join(path.dirname(path.dirname(path.dirname(modulePath))), 'src', 'locales');
26385
+ console.log("localesPath : ", localesPath);
26386
+ i18n
26387
+ .use(Backend)
26388
+ .use(LanguageDetector)
26389
+ .use(initReactI18next)
26390
+ .init({
26391
+ backend: {
26392
+ // translation file path
26393
+ loadPath: localesPath + '/i18n/{{ns}}/{{lng}}.json',
26394
+ },
26395
+ //NOTE - Uncomment to reset the language to english once the user coming back again
26396
+ // lng: 'en',
26397
+ fallbackLng: 'en',
26398
+ //NOTE - Disabled in production
26399
+ debug: true,
26400
+ //separate name spaces for each pages
26401
+ ns: [
26402
+ 'common',
26403
+ 'login',
26404
+ 'dashboard',
26405
+ 'nav',
26406
+ 'company',
26407
+ 'user',
26408
+ 'programme',
26409
+ 'view',
26410
+ 'homepage',
26411
+ 'ndcAction',
26412
+ 'coBenifits',
26413
+ 'environment',
26414
+ 'genderParity',
26415
+ 'safeguards',
26416
+ 'social',
26417
+ 'economic',
26418
+ 'creditTransfer',
26419
+ 'addProgramme',
26420
+ ],
26421
+ });
26422
+
26377
26423
  export { Action, AddNdcActionComponent, AddNewCompanyComponent, AddNewUserComponent, AdminBGColor, AdminColor, BaseEntity, CarbonSystemType, CertBGColor, CertColor, CoBenifitsComponent, Company, CompanyManagementColumns, CompanyManagementComponent, CompanyProfileComponent, CompanyRole, CompanyState, ConfigurationSettingsType, CreditTransferComponent, CreditTransferStage, DevBGColor, DevColor, DocType, DocumentStatus, ESGType, EnergyGenerationUnits, FormElementType, GovBGColor, GovColor, ImgWithFallback, InfoView, Instrument, InvestmentBGColor, InvestmentBody, InvestmentColor, InvestmentCreationComponent, InvestmentCreationType, InvestmentLevel, InvestmentManagementComponent, InvestmentStatus, InvestmentStream, InvestmentType, LandAreaUnits, LegendItem, Loading, ManagerBGColor, ManagerColor, MapComponent, MapTypes, MapboxComponent, MinBGColor, MinColor, MitigationTypes, MrvDashboardComponent, MrvStatsCardsTypes, NdcActionBody, NdcActionManagementComponent, NdcActionStatus, NdcActionTypes, NdcActionViewComponent, NdcDetailsComponent, OrganisationStatus, ProfileIcon, ProgrammeCertify, ProgrammeCreationComponent, ProgrammeDocuments, ProgrammeEntity, ProgrammeIssueForm, ProgrammeManagementColumns, ProgrammeManagementComponent, ProgrammeRetireForm, ProgrammeRevokeForm, ProgrammeStageLegend, ProgrammeStageMRV, ProgrammeStageR, ProgrammeStageUnified, ProgrammeTransfer, ProgrammeTransferForm, RadioButtonStatus, RadioButtonStatus2, RegistryDashboardComponent, RejectDocumentationConfirmationModel, RetireType, Role, RoleIcon, RootBGColor, RootColor, SdgGoals$1 as SdgGoals, Sector, SectoralScope, StasticCard, StatsCardsTypes, SupportCreationComponent, SupportManagementComponent, SystemNames, TimelineBody, Titles, TooltipColor, TransferActionModel, TxType, TypeOfMitigation, UnitField, User, UserManagementColumns, UserManagementComponent, UserProfileComponent, UserRoleIcon, ViewBGColor, ViewColor, WidgetType, addCommSep, addCommSepRound, addRoundNumber, addSpaces, consumerGroupList, creditUnit, dateFormat, dateTimeFormat, energyGenerationUnitList, getBase64, getCompanyBgColor, getCreditStageVal, getFinancialFields, getGeneralFields, getInvestmentStatusEnumVal, getNdcActionStatusEnumVal, getNdcStatusTagType, getRetirementTypeString, getStageEnumVal, getStageTagType, getStageTagTypeMRV, getStageTransferEnumVal, getStatusTagType, getTransferStageTagType, isBase64, landAreaUnitList, mitigationTypeList, ndcActionTypeList, sectorMitigationTypesListMapped, sumArray, titleList };
26378
26424
  //# sourceMappingURL=index.js.map